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-17361] [jdbc] Added custom query on JDBC tables #11986
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 8c15ff1 (Fri Oct 16 10:53:51 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:
|
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 your contribution! I like that you didn't forget about also adding documentation. 😃
I had one comment in the test that is a bit more important and a minor nitpick about wording in the documentation.
")" | ||
); | ||
|
||
StreamITCase.clear(); |
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 using the static StreamITCase
functionality here is an anti-pattern that we should avoid. (I know that it's widely used in the code base, but we should rid of it at some point.)
Ideally, with the FLIP-84 work it should be as easy as
TableResult tableResult = tEnv.executeSql("SELECT timestamp6_col, decimal_col FROM " + INPUT_TABLE);
tableResult.collect();
but that is not yet in master. I'm inclined to wait for a but but basically have this PR ready in a mergable state.
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 just copied the code from another test and I modifier it. I didn't ask myself too much why there's the need to call StreamITCase.clear()
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 understand, the code code that is there is already not good. 😞
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.
Maybe we can merge this and open an issue to fix the tests in this class to the right way when FLIP-84 will be ready
…ad of StreamITCase Using the static sink approach of StreamITCase is potentially problematic with concurrency, plus the code is just plain nicer like this.
@fpompermaier I rebased this on |
Thanks a lot! I merged it before you answered, I hope that's ok. (I wanted to get it in in time for Flink 1.11) |
Thanks a lot @aljoscha |
assertThat( | ||
results, | ||
containsInAnyOrder( | ||
"2020-01-01T15:35:00.123456,100.1234", |
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.
@aljoscha for the future: please use instances instead of strings
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.
Noted, that's a very good point.
What is the purpose of the change
Enable users to create a JDBC source table using a custom query / prepared statement.
Brief change log
Verifying this change
This change is already covered by existing tests, such as JDBCTableSourceSinkFactoryTest and JDBCTableSourceITCase.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation