New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-15479]Override explainSource method for JDBCTableSource #10769
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 7fe9e7e (Sun Jan 05 14:45:13 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
CI report:
Bot commandsThe @flinkbot bot supports the following commands:
|
@wangxlong could you add a test for jdbc project push down? |
I think we should fix the default implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wangxlong , As @wuchong suggestion, can you add tests to verify?
I think we should fix the default implementation of explainSource in TableSource
+1, but we can fix it in 1.11? It is non-minor change, better to do it in 1.11, we can create a JIRA to discuss it more.
Thank you for your advice@wuchong @godfreyhe @JingsongLi . It is my duty to add a jdbc project push down test to verify. I am ok to fix it in 1.11. |
Hi @wangxlong , What I mean:
Option 1 and Option 2 can be two things to finish. (We can do option 1 in 1.10 and 1.9, do option 2 in master) |
@JingsongLi I am sorry. It is my misunderstanding. I have added a test. Should I close this, and then open two pull request against release-1.9 and release-1.10? Or we can also do option1 on master, This maybe not conflict with option2? BTW, Should I open a JIRA to discuss option2? |
@wangxlong Yes, you can. |
// test jdbc table source description | ||
List<String> fieldNames = ((RowType) actual.getProducedDataType().getLogicalType()).getFieldNames(); | ||
String expectedSourceDescription = actual.getClass().getSimpleName() | ||
+ "(" + String.join(", ", fieldNames.stream().toArray(String[]::new)) + ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add an integreation test to verify the JDBC source can work when project is pushed down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wuchong Good idea. I have updated.
ping @wuchong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great effort @wangxlong .
Regarding to the integration tests, I have some suggestions:
- Could you use Blink planner instead of Old planner? Because Old planner is deprecated, and all the new features are added to Blink planner.
- Could you use DDL to create JDBC tables to have a better coverage?
registerTableSource
is derpected. - Could you move the instantiation of
tEnv
to static member field? This can avoid repetitive SPI discovery.
/** | ||
* IT case for {@link JDBCTableSource}. | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line.
Thanks @wuchong, I have updated. |
" 'connector.driver' = 'org.apache.derby.jdbc.EmbeddedDriver' " + | ||
")"; | ||
|
||
static { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use @BeforeClass
instead of static code block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Done.
flink-connectors/flink-jdbc/pom.xml
Outdated
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set the scope only for test
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, It is ok to set scope as test
. But I don't know why set provide in old planner before.
ping @wuchong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wangxlong for the effort, LGTM.
… to fix project pushdown (#10769)
What is the purpose of the change
Override explainSource method for JDBCTableSource.
Brief change log
Add explainSource for JDBCTableSource.
Verifying this change
(Please pick either of the following options)
This change is a trivial work without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation