Repository navigation
[FLINK-41660][pipeline-connector/postgres] Register scan.incremental.snapshot.chunk.key-column as an optional option - #4636
Merged
yuxiqian merged 1 commit intoNov 25, 2026
Conversation
…snapshot.chunk.key-column as an optional option PostgresDataSourceFactory reads scan.incremental.snapshot.chunk.key-column and forwards it to the underlying Postgres source, but did not register the option in optionalOptions(). FactoryHelper therefore rejected any pipeline configuration that set it: ValidationException: Unsupported options found for 'postgres'. Unsupported options: scan.incremental.snapshot.chunk.key-column Add the option to optionalOptions(), matching the MySQL and SQLServer pipeline source factories, and cover it with a unit test.
YasuoStudyJava
force-pushed
the
FLINK-41660-postgres-chunk-key-column
branch
from
November 25, 2026 08:33
1c06f89 to
4a82259
Compare
yuxiqian
approved these changes
Nov 25, 2026
yuxiqian
left a comment
Member
There was a problem hiding this comment.
+1, waiting for CI to pass...
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 free
to 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.
PostgresDataSourceFactory reads scan.incremental.snapshot.chunk.key-column and forwards it to the underlying Postgres source, but did not register the option in optionalOptions(). FactoryHelper therefore rejected any pipeline configuration that set it:
ValidationException: Unsupported options found for 'postgres'.
Unsupported options:
scan.incremental.snapshot.chunk.key-column
Add the option to optionalOptions(), matching the MySQL and SQLServer pipeline source factories, and cover it with a unit test.
What is the purpose of this pull request?
Fixes FLINK-41660.
PostgresDataSourceFactoryreadsscan.incremental.snapshot.chunk.key-columnand forwards it to theunderlying Postgres source, but the option was never registered in
optionalOptions(). As a result,FactoryHelperrejects any pipeline configuration that sets it:This makes it impossible to configure a chunk key column for tables without a primary key, which is
the main use case of the option. The MySQL and SQLServer pipeline source factories already register
the same option; Postgres did not.
Brief change log
PostgresDataSourceFactory#optionalOptions(): registerSCAN_INCREMENTAL_SNAPSHOT_CHUNK_KEY_COLUMN.PostgresDataSourceFactoryTest#testChunkKeyColumnOption, asserting the option is part ofoptionalOptions()and that its value reachesPostgresSourceConfig#getChunkKeyColumn().Verifying this change
This change added tests and can be verified as follows:
flink-cdc-pipeline-connector-postgres(PostgresDataSourceFactoryTest)PostgresDataSourcewithscan.incremental.snapshot.chunk.key-columnsetfailed with the
ValidationExceptionabove; with the fix the source is created and the configuredchunk key column is propagated to the source configuration.
mvn spotless:apply/spotless:checkpassDocumentation
docs/content/docs/connectors/pipeline-connectors/postgres-cdc.md; this change only makes it usableWas generative AI tooling used to co-author this PR?
Generated-by: CodeMaker (Deepseek Flash)