Create a GCP Lakehouse Writer application
Before creating a GCP Lakehouse Writer application, you must complete the steps in GCP Lakehouse Writer initial setup.
Configure GCP Lakehouse Writer
You can configure GCP Lakehouse Writer in Flow Designer or TQL.
Configure the target in Flow Designer
Create or open a Striim application.
Add and configure a source adapter.
In the component search, search for Google Cloud Lakehouse.
Drag the target into the flow.
Connect the source output stream to the GCP Lakehouse Writer target.
Enter a target name.
Set DataLakeConnectionProfileName to the GCS Connection Profile for the Iceberg table location.
Set ComputeConnectionProfileName to the GCP Managed Apache Spark Connection Profile.
Set CatalogConnectionProfileName to the GCP Lakehouse Runtime Catalog Connection Profile.
Set ExternalStagingLocation to a GCS staging folder.
Set IcebergTablesLocation to the Iceberg warehouse location.
Set Tables to the source-to-target table mapping.
Set Mode to APPENDONLY for initial load or MERGE for CDC.
Configure UploadPolicy, CDDLAction, OptimizedMerge, and ParallelThreads as needed.
Save, deploy, and run the application.
TQL example
CREATE OR REPLACE TARGET GCPLakehouseTarget USING Global.GCPLakehouseWriter (
DataLakeConnectionProfileName: 'admin.GCSDataLake', ComputeConnectionProfileName: 'admin.GCPManagedApacheSparkCP', CatalogConnectionProfileName: 'admin.GCPLakehouseRuntimeCatalogCP', IcebergTablesLocation: 'gs://my-bucket', ExternalStagingLocation: 'gs://my-stage-bucket/striim-stage', Tables: 'SRC.%,TGT.%', Mode: 'APPENDONLY', UploadPolicy: 'eventcount:100000,interval:10s', CDDLAction: 'Process' ) INPUT FROM MySQLOut;
Writing initial snapshot data
Use APPENDONLY mode for initial snapshot loads. Snapshot loads can be performed from RDBMS sources and other sources that support initial load mode, such as SalesforceReader and MongoDBReader.
In APPENDONLY mode, source records are collected into batches. When a batch meets the configured UploadPolicy, GCP Lakehouse Writer executes the batch as inserts to the target Iceberg tables.
Initial load parallelism
Use ParallelThreads to accelerate initial load processing when the GCP Managed Apache Spark cluster has enough executor capacity. For OLTP initial loads, configure parallel threads on both the source reader and GCP Lakehouse Writer where applicable.
The Spark cluster should have at least as many worker cores as the number of parallel writer threads.
Initial load recovery
Initial load recovery is tracked at table level. After restart, GCP Lakehouse Writer does not rewrite snapshot data into a table that already completed its initial load.
Writing CDC data
Use MERGE mode for CDC workloads. The source adapter should capture changes in incremental or CDC mode. Source inserts, updates, and deletes are collected into batches. When a batch meets the configured UploadPolicy, GCP Lakehouse Writer executes the batch through the compute engine.
Optimized merge
Enable OptimizedMerge only in MERGE mode. With optimized merge enabled, GCP Lakehouse Writer can process CDC events that contain only updated fields and key fields for update and delete operations. This allows source CDC readers to send partial images for update and delete operations.
MERGE mode requires a usable key for each target table. You can provide keys with the keycolumns option in the Tables property. If keycolumns is not provided, Striim uses the source table primary key when available. If neither is available, Striim concatenates all column values to identify a row.
Delivery, recovery, and consistency
GCP Lakehouse Writer provides at-least-once delivery, not exactly-once delivery. During recovery, Striim may reprocess events from the last incomplete batch.
In MERGE mode, reprocessing is generally safe when the target has stable key columns because repeated updates or deletes are applied to the same keyed rows. In APPENDONLY mode, there is no de-duplication step, so a restart can produce duplicate rows in the target table.
Concurrent writes
GCP Lakehouse Writer does not implement its own retry logic for Iceberg commit conflicts. Each batch is executed as a Spark job against the target Iceberg table. The commit is governed by Iceberg optimistic concurrency behavior inside the Spark job.
If two writer instances or two applications attempt to commit to the same target table at overlapping times and Iceberg does not resolve the conflict internally, Striim surfaces a write failure.
If you are using MERGE mode, avoid configuring more than one GCP Lakehouse Writer instance or more than one Striim application to write concurrently to the same target table. If concurrent writers are unavoidable, design the flow error-handling policy with the understanding that Striim does not provide an additional commit-conflict retry layer beyond Iceberg client behavior.
Table mapping
Use the Tables property to map source tables to target Iceberg tables.
Rules:
Separate the source table and target table with a comma.
The target Iceberg table can contain multiple namespace parts separated by dots. The last part is the table name.
Separate multiple mappings with semicolons.
Use % as a wildcard to match multiple source tables within a namespace or schema.
Example of a fully qualified namespace:
namespace1.table1
Example table mapping:
SRC.CUSTOMERS,sales.customers;SRC.ORDERS,sales.orders
Wildcard example:
SRC.%,sales.%
Key columns
Use keycolumns to control row identification in target tables.
SCOTT.EMP,mydataset.employee keycolumns(emp_num)
Wildcards can be used for the source table when all matching tables have usable key columns:
DEMO.%,mydataset.% KeyColumns(...)
If keycolumns is not provided, Striim uses the source table primary key. If neither keycolumns nor a source primary key is available, Striim concatenates all column values to create a unique row identifier.
Column mapping
Use ColumnMap when source and target columns do not match directly.
<source table>,<target table> ColumnMap(<target column>=<source column>,...)
Use column mapping to reorder columns or skip unmapped source columns. If a source DDL drops a column that is explicitly referenced in ColumnMap, the application halts because the mapping can no longer be satisfied.
Special character support
In MERGE mode, the only supported special character in table names is underscore (_).
Special character | Table name in APPENDONLY mode | Column name |
|---|---|---|
_ | Yes | Yes |
$ | Yes | Yes |
@ | Yes | Yes |
# | Yes | No |
% | Yes | Yes |
^ | Yes | Yes |
& | Yes | Yes |
* | Yes | Yes |
( | Yes | Yes |
) | Yes | Yes |
\ | No | No |
/ | No | Yes |
+ | Yes | Yes |
= | Yes | Yes |
? | Yes | Yes |
[ | Yes | Yes |
] | Yes | Yes |
{ | Yes | Yes |
} | Yes | Yes |
- | Yes | Yes |
! | Yes | Yes |
` | ` | Yes |
Getting started example: Oracle to GCP Lakehouse Writer
This example walks through creating an initial load application and a CDC application that move data from Oracle into GCP Lakehouse Writer. You can adapt the same flow to other supported sources.
1. Complete initial setup
Upload setupIcebergDataprocV1.sh to a GCS bucket in the same project as the Spark cluster.
Note the gs:// URI for the initialization script.
Create the GCP Managed Apache Spark cluster.
Use a Spark 3.5.1-compatible image.
Enable Spark performance enhancements.
Enable the component gateway.
Add the initialization script path under Initialization actions.
Make sure Internal IP only is not checked.
Create or reuse a service account and obtain its JSON key.
Grant the service account the roles required by your catalog mode.
2. Create the Striim Connection Profiles
In Striim, go to Manage Striim > Connection Profiles > Create Connection Profile.
Create a GCP Managed Apache Spark Connection Profile:
Select GCPManagedApacheSpark / Google Cloud Managed Apache Spark.
Enter ProjectID, Region, and DataProcClusterName.
Attach the service account key.
Click Test Connection.
Create a GCS Connection Profile:
Select GCS.
Attach the service account key for the account that can access the data lake and staging buckets.
Click Test Connection.
Create a GCP Lakehouse Runtime Catalog Connection Profile:
Select GCPLakehouseRuntimeCatalog / Google Cloud Lakehouse Runtime Catalog.
Set CatalogEndpointType to IcebergRESTCatalog or CustomIcebergCatalogForBigQuery.
Enter ProjectID and Region.
If using REST mode with credential vending, enable CredentialVending to match the catalog configuration in Google Cloud.
Click Test Connection.
3. Build the initial load application
Go to Apps > Create an App > Start from scratch.
Add the Oracle Initial Load source.
Configure the Oracle connection and select the schemas and tables to migrate.
Under Schema and Data Handling, enable Create Schema so GCP Lakehouse Writer can create target namespaces and tables.
Save the source.
Add the GCP Lakehouse Writer target by searching for Google Cloud Lakehouse.
Connect the source output stream to the target.
Set DataLakeConnectionProfileName to the GCS data lake Connection Profile.
Set ComputeConnectionProfileName to the GCP Managed Apache Spark Connection Profile.
Set CatalogConnectionProfileName to the GCP Lakehouse Runtime Catalog Connection Profile.
Set ExternalStagingLocation to a GCS folder that is distinct from the warehouse location.
Set IcebergTablesLocation to the warehouse root folder.
Set Mode to APPENDONLY.
Set Tables to the source-to-target mapping.
Save the target.
Deploy and run the app. The app replicates the current snapshot of the selected Oracle tables into GCS in Iceberg format. Monitor progress with Striim metrics, the SHOW command, and Google Cloud Spark job views.
4. Build the CDC application
Add an Oracle Reader CDC source and configure it with the wizard.
Add and configure GCP Lakehouse Writer as the target.
Use the output stream from the Oracle CDC source.
Set Mode to MERGE.
Configure key columns if needed.
Save, deploy, and run the application.
The CDC application applies live inserts, updates, and deletes from Oracle to the target Iceberg tables.