Spark Lake Table Merge
DescriptionSpark Lake Table Merge applies a Spark SQL The single main-stream upstream hop is the merge source. The transform builds (or accepts) MERGE SQL, executes it as a Spark action, and registers an empty leaf Dataset. Connectors ship with the native Spark plugin. Session rules: Lakehouse tables on the native Spark engine. |
Options
| Option | Description |
|---|---|
Transform name | Unique name of the transform in the pipeline. |
Format |
|
Identifier mode |
|
Table path / Table identifier / Spark Catalog | Same semantics as Lake Table Input/Output for the merge target. |
Merge condition |
|
When matched |
|
When not matched |
|
When not matched by source |
|
Raw MERGE SQL | Advanced override. When non-empty, replaces structured fields. Empty by default. Operator is trusted to supply valid SQL. |
Behaviour
-
Source rows are registered as a temporary view; structured mode emits SQL similar to:
MERGE INTO delta.`/path/to/table` AS t USING hop_merge_src_… AS s ON t.id = s.id WHEN MATCHED THEN UPDATE SET * WHEN NOT MATCHED THEN INSERT *
-
Target SQL ids: Delta PATH →
delta.\`path`; Iceberg PATH →hop_iceberg.\`uri\`; TABLE → multi-part identifier. -
At least one action (matched and/or not-matched) is required.
-
Metrics are log-only (merge completion); GUI in/out row counts for the sink may stay at zero.
Metadata injection
Supports metadata injection.
Keys: FORMAT, IDENTIFIER_MODE, TABLE_PATH, TABLE_IDENTIFIER, CATALOG_METADATA_NAME, MERGE_CONDITION, MATCHED_ACTION, NOT_MATCHED_ACTION, NOT_MATCHED_BY_SOURCE_ACTION, RAW_MERGE_SQL.
Useful for multi-table CDC/upsert templates where merge keys and target tables vary per run.
Notes
-
Exactly one main-stream input hop.
-
Prefer structured fields for common upserts; use raw SQL only when you need full MERGE control.
-
Packaging and PATH vs TABLE: lakehouse guide.