[FLINK-38733] Add new SplitterEnumerator on JdbcSource#180
Conversation
35399ed to
59dea79
Compare
|
@ferenc-csaky can you have a look when have free time.. |
ferenc-csaky
left a comment
There was a problem hiding this comment.
Did not check the implementation details yet, added some interface-related comments.
cdbee4f to
6964598
Compare
6964598 to
63ad89f
Compare
63a2301 to
4b0c038
Compare
RocMarshal
left a comment
There was a problem hiding this comment.
Thanks @eskabetxe .
It looks better now.
Left a few of comments, PTAL.
|
Thx for the update. LGTM on the whole, just left a few of minor comments. |
087a11a to
89b104a
Compare
2688172 to
4f5aae9
Compare
4f5aae9 to
d5b14dd
Compare
|
@RocMarshal I have rebase and tests are passing now.. if you could recheck.. |
|
Hi, @eskabetxe Thanks for the ping. |
RocMarshal
left a comment
There was a problem hiding this comment.
Hi, @eskabetxe Sorry for the late response.
LGTM +1 now,
Hi, @snuyanzin @ferenc-csaky Could you help take a look ? thx
|
@RocMarshal @ferenc-csaky any news on this? |
|
Hi @ferenc-csaky can you take a look here? |
97ae616 to
c4e8376
Compare
|
@ruanhang1993 thanks for your review.. |
|
@snuyanzin @ruanhang1993 can you recheck? |
a8f2a99 to
8f4cdeb
Compare
| int paramLength = params.length; | ||
| List<JdbcSourceSplit> splitList = new ArrayList<>(paramLength); | ||
| if (paramLength == 0) { | ||
| splitList.add(createSplit(null)); |
There was a problem hiding this comment.
There is a different behavior in the new enumerator.
For the old enumerator SqlTemplateSplitEnumerator:
- When the
paramLengthis 0 inSqlTemplateSplitEnumerator#enumerateSplits, it will return an empty list. - When the
paramsis null inSqlTemplateSplitEnumerator#enumerateSplits, it will return a jdbc split with the null param.
For the new enumerator SqlSplitterEnumerator:
- When the
paramLengthis 0 inSqlSplitterEnumerator#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?
There was a problem hiding this comment.
@ruanhang1993 you are right..
fixed and add a test to avoid future regression
if you can check again I appreciate
|
@ruanhang1993 can you recheck please |
e939e22 to
b818753
Compare
|
@snuyanzin @ruanhang1993 can you recheck? |
b818753 to
dd28adf
Compare
|
Hi, @eskabetxe @snuyanzin @ruanhang1993 |
|
Is completed, need only finish the revision.. |
|
+1 to merge from my side once ci is green |
|
Thanks all involved in the improvement. |
This pull request refactors the JDBC source split enumeration logic in the Flink connector, replacing the previous
SqlTemplateSplitEnumeratorand related classes with a new abstraction calledSplitterEnumerator. 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
SqlTemplateSplitEnumeratorandJdbcSqlSplitEnumeratorBasewith the newSplitterEnumeratorabstraction acrossJdbcSource,JdbcSourceBuilder, andJdbcSourceEnumerator, updating constructors, fields, and method calls accordingly. [1] [2] [3] [4]SplitterEnumerator, and added logic to select the appropriate splitter implementation based on provided parameters. [1] [2] [3]Lineage and Testing Updates
SqlTemplateSplitEnumerator. [1] [2]Miscellaneous