Skip to content

Updated streaming docs. - #179

Merged
sbyrne-sf merged 2 commits into
mainfrom
docUpdates
Dec 1, 2026
Merged

sbyrne-sf merged 2 commits into
mainfrom
docUpdates

Conversation

@sbyrne-sf

Copy link
Copy Markdown
Contributor

No description provided.

joroscoSF
joroscoSF previously approved these changes Nov 25, 2026
Comment thread docs/streaming_cdf.md Outdated

```
### Deduplication of Row Per-Microbatch
The written dataframe cannot contain two rows with the same primary key. The SDK includes a default two-step deduplication pass that first picks the row with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we went back and forth on this, but in a way this is not a default impl in that users must provide dedup_order and provide its values themselves. Might be better to say a "standard" option (and the rest of the sentence is perfect).

Comment thread docs/streaming_cdf.md Resolved
Comment thread docs/streaming_cdf.md Outdated
| _commit_version | long | per-source DLO |
| _commit_timestamp | timestamp | when the commit landed in the source DLO, not exact |
| _source_table_name | string | the source DLO for the row |
| _source_record_key | string, opaque | The source DLO's PK value for this row |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PK aspect of this is kind of an impl detail we don't want customers thinking about (because it could change in the future). For the Notes column, what about something like: "An opaque string that identifies a source row. It is specific to each source DLO: two DLOs never share a value, even if their primary keys and row contents are identical. Rows with the same _source_record_key are versions of one source row. This can be a helpful partition for deduplication, for example to order by _commit_version."

Comment thread docs/streaming_cdf.md Outdated
The DataFrame you write must have:

* _merge_record_type: UPSERT or DELETE.
* _commit_version, _source_table_name and _source_record_key, as read. The sink uses them to find the latest version of each source record.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is out of date and we can remove it altogether. _merge_record_type is the only required "system" / non-written column. All others are only required if they are used in dedup_order.

Comment thread docs/streaming_cdf.md Outdated
* _commit_version, _source_table_name and _source_record_key, as read. The sink uses them to find the latest version of each source record.
* The target DLO's PK columns.

The stream fails at start if any of these is missing. Columns that aren't in the target DLO, including every system column, aren't written.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also note that _change_type must be dropped? I'm creating a WI to re-consider how forcefully it's rejected - right now if you send _change_type into the write_dlo_deltas it will fail very early in the process. But for now, it's important to know it must be dropped from the dataframe.

Comment thread docs/streaming_cdf.md Outdated
### Deduplication of Row Per-Microbatch
The written dataframe cannot contain two rows with the same primary key. The SDK includes a default two-step deduplication pass that first picks the row with
the latest commit version and then picks upserts over deletes. Depending on the shape of your data, this may not be enough to pick a single row. Full control
of the deduplication is available by setting the dedup_order parameters in write_*_deltas methods. The parameter is an ordered list of entries `{"column", "direction", "partition"}`. Each entry narrows, within its partition, to the rows tied on its column. `partition` is optional and names any column in your DataFrame; an entry without it runs per target primary key. Entries with `partition` must come before entries without it. If more than one row is left for a key after the last entry, the batch fails.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: full control isn't only available, it's actually required. dedup_order is required, and the values in it are completely up to the customer.

Comment thread docs/streaming_cdf.md Outdated
### Deduplication of Row Per-Microbatch
The written dataframe cannot contain two rows with the same primary key. The SDK includes a default two-step deduplication pass that first picks the row with
the latest commit version and then picks upserts over deletes. Depending on the shape of your data, this may not be enough to pick a single row. Full control
of the deduplication is available by setting the dedup_order parameters in write_*_deltas methods. The parameter is an ordered list of entries `{"column", "direction", "partition"}`. Each entry narrows, within its partition, to the rows tied on its column. `partition` is optional and names any column in your DataFrame; an entry without it runs per target primary key. Entries with `partition` must come before entries without it. If more than one row is left for a key after the last entry, the batch fails.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to go into the details of what a DedupConflictException look like, and how to understand it?

Comment thread docs/streaming_cdf.md Resolved
Comment thread docs/streaming_cdf.md Resolved
@sbyrne-sf
sbyrne-sf merged commit 0647c42 into main Dec 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants