Skip to content

[FLINK-38733] Add new SplitterEnumerator on JdbcSource#180

Merged
RocMarshal merged 8 commits into
apache:mainfrom
eskabetxe:source_dinamically
Jun 18, 2026
Merged

[FLINK-38733] Add new SplitterEnumerator on JdbcSource#180
RocMarshal merged 8 commits into
apache:mainfrom
eskabetxe:source_dinamically

Conversation

@eskabetxe

Copy link
Copy Markdown
Member

This pull request refactors the JDBC source split enumeration logic in the Flink connector, replacing the previous SqlTemplateSplitEnumerator and related classes with a new abstraction called SplitterEnumerator. The builder and enumerator classes are updated to use this new abstraction, simplifying split management and improving extensibility. The changes also update lineage handling and testing methods to use the new splitter abstraction.

Split Enumeration Refactoring

  • Replaced SqlTemplateSplitEnumerator and JdbcSqlSplitEnumeratorBase with the new SplitterEnumerator abstraction across JdbcSource, JdbcSourceBuilder, and JdbcSourceEnumerator, updating constructors, fields, and method calls accordingly. [1] [2] [3] [4]
  • Updated the builder to support setting a custom SplitterEnumerator, and added logic to select the appropriate splitter implementation based on provided parameters. [1] [2] [3]
  • Refactored enumerator startup and split assignment logic to use the new splitter, improving asynchronous split enumeration and handling both bounded and unbounded modes.

Lineage and Testing Updates

  • Changed lineage vertex extraction to use the new splitter abstraction for query information, removing direct calls to SqlTemplateSplitEnumerator. [1] [2]
  • Updated visible-for-testing methods to expose the new splitter abstraction instead of the old provider.

Miscellaneous

  • Updated equality checks and state snapshot logic to use the new splitter abstraction and its serializable state. [1] [2]
  • Removed obsolete annotations for the old split enumerator methods in the architecture violation files.

@eskabetxe eskabetxe force-pushed the source_dinamically branch 6 times, most recently from 35399ed to 59dea79 Compare November 25, 2025 17:12
@eskabetxe

Copy link
Copy Markdown
Member Author

@ferenc-csaky can you have a look when have free time..

@ferenc-csaky ferenc-csaky left a comment

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.

Did not check the implementation details yet, added some interface-related comments.

@eskabetxe eskabetxe force-pushed the source_dinamically branch 2 times, most recently from cdbee4f to 6964598 Compare November 28, 2025 11:16
@eskabetxe eskabetxe requested a review from RocMarshal December 15, 2025 15:58
@eskabetxe eskabetxe force-pushed the source_dinamically branch 3 times, most recently from 63a2301 to 4b0c038 Compare December 15, 2025 16:33

@RocMarshal RocMarshal left a comment

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.

Thanks @eskabetxe .

It looks better now.
Left a few of comments, PTAL.

@RocMarshal

RocMarshal commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Thx for the update. LGTM on the whole, just left a few of minor comments.

@eskabetxe eskabetxe force-pushed the source_dinamically branch 2 times, most recently from 087a11a to 89b104a Compare January 19, 2026 17:41
@eskabetxe eskabetxe force-pushed the source_dinamically branch 2 times, most recently from 2688172 to 4f5aae9 Compare January 20, 2026 09:12
@eskabetxe

Copy link
Copy Markdown
Member Author

@RocMarshal I have rebase and tests are passing now.. if you could recheck..

@RocMarshal

Copy link
Copy Markdown
Contributor

Hi, @eskabetxe Thanks for the ping.
As mentioned in https://apache-flink.slack.com/archives/C03GV7L3G2C/p1771922394391139
After the version tags ready, I'll advance the next steps of some pending PRs(included this one) .

@RocMarshal RocMarshal left a comment

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.

Hi, @eskabetxe Sorry for the late response.

LGTM +1 now,

Hi, @snuyanzin @ferenc-csaky Could you help take a look ? thx

@eskabetxe

Copy link
Copy Markdown
Member Author

@RocMarshal @ferenc-csaky any news on this?

@eskabetxe

Copy link
Copy Markdown
Member Author

Hi @ferenc-csaky can you take a look here?

@eskabetxe eskabetxe force-pushed the source_dinamically branch 2 times, most recently from 97ae616 to c4e8376 Compare May 9, 2026 12:00
@eskabetxe

Copy link
Copy Markdown
Member Author

@ruanhang1993 thanks for your review..
fixed all comments, if you can review again..

@eskabetxe

Copy link
Copy Markdown
Member Author

@snuyanzin @ruanhang1993 can you recheck?
I solve all comments

@eskabetxe eskabetxe force-pushed the source_dinamically branch from a8f2a99 to 8f4cdeb Compare May 13, 2026 20:45
int paramLength = params.length;
List<JdbcSourceSplit> splitList = new ArrayList<>(paramLength);
if (paramLength == 0) {
splitList.add(createSplit(null));

@ruanhang1993 ruanhang1993 May 14, 2026

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.

There is a different behavior in the new enumerator.

For the old enumerator SqlTemplateSplitEnumerator:

  • When the paramLength is 0 in SqlTemplateSplitEnumerator#enumerateSplits, it will return an empty list.
  • When the params is null in SqlTemplateSplitEnumerator#enumerateSplits, it will return a jdbc split with the null param.

For the new enumerator SqlSplitterEnumerator:

  • When the paramLength is 0 in SqlSplitterEnumerator#enumerateSplits, it will return a jdbc split with the null param.

When the next split is not available,SlideTimingSplitterEnumerator#getSqlParameters will return an empty params , which will cause that it will return a jdbc split with the null param. The jdbc split with a null param will throw an exception in prepareStatement. So the job may fail for this.

WDYT?

@eskabetxe eskabetxe May 26, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ruanhang1993 you are right..
fixed and add a test to avoid future regression

if you can check again I appreciate

@eskabetxe

Copy link
Copy Markdown
Member Author

@ruanhang1993 can you recheck please

@eskabetxe eskabetxe force-pushed the source_dinamically branch from e939e22 to b818753 Compare June 9, 2026 08:30
@eskabetxe

Copy link
Copy Markdown
Member Author

@snuyanzin @ruanhang1993 can you recheck?

@eskabetxe eskabetxe force-pushed the source_dinamically branch from b818753 to dd28adf Compare June 9, 2026 12:21
@RocMarshal

Copy link
Copy Markdown
Contributor

Hi, @eskabetxe @snuyanzin @ruanhang1993
May I know : Is this feature planned to be completed before v5.0?
Thx
CC @och5351

@eskabetxe

Copy link
Copy Markdown
Member Author

Is completed, need only finish the revision..

@snuyanzin

Copy link
Copy Markdown
Contributor

+1 to merge from my side once ci is green

@RocMarshal

Copy link
Copy Markdown
Contributor

Thanks all involved in the improvement.
The CI was successful.
So merging...

@RocMarshal RocMarshal merged commit af99465 into apache:main Jun 18, 2026
7 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants