Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [Feature](streamjob) Streaming job support cdc_stream TVF #61826 - #61970
Merged
Conversation
### What problem does this PR solve? Previously, streaming jobs only supported the non-TVF path (FROM Source TO Database) for CDC ingestion. This PR adds support for streaming jobs to drive CDC ingestion via the cdc_stream Table-Valued Function (TVF), enabling a more flexible and SQL-native approach. ```sql CREATE JOB test_streaming_job_cdc_stream_postgres_name ON STREAMING DO INSERT INTO db.table SELECT name, age FROM cdc_stream( "type" = "postgres", "jdbc_url" = "jdbc:postgresql://127.0.0.1:5432/postgres", "driver_url" = "postgresql-42.5.0.jar", "driver_class" = "org.postgresql.Driver", "user" = "postgres", "password" = "123456", "database" = "postgres", "schema" = "cdc_test", "table" = "test_streaming_job_cdc_stream_postgres_src", "offset" = "initial" ) ``` Core flow: 1. Snapshot phase: FE fetches split chunks from BE, persists them to the meta table, then creates one StreamingInsertTask per split (or batch). The TVF parameters are rewritten per-task with meta (split boundary info), job.id, and task.id. 2. Binlog phase: After all snapshot splits are completed, transitions to continuous binlog ingestion via the same cdc_stream TVF with binlog offset as meta. 3. Offset commit (2PC safe): After fetchRecordStream completes on BE, the actual end offset is stored in PipelineCoordinator.taskOffsetCache. FE pulls this via brpc in beforeCommitted and stores it in the txn attachment — ensuring the offset is committed atomically with the data. 4. FE restart recovery: State is recovered via txn replay (replayOnCommitted) rather than EditLog, rebuilding chunkHighWatermarkMap and remainingSplits from the meta table.
hello-stephen
commented
Mar 31, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
Mar 31, 2026
Contributor
run buildall |
JNSimba
commented
Mar 31, 2026
Member
run nonConcurrent |
yiguolei
approved these changes
Apr 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #61826