-
Notifications
You must be signed in to change notification settings - Fork 13k
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-24861][connector][jdbc] Fix false cache lookup for empty data #17754
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 29cfbf7 (Wed Nov 10 13:53:00 UTC 2021) 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:
|
look 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.
@gaurav726 thanks for the contribution, I left some comments
@@ -174,6 +175,7 @@ public void testJdbcLookupProperties() { | |||
.setCacheMaxSize(1000) | |||
.setCacheExpireMs(10_000) | |||
.setMaxRetryTimes(10) | |||
.setExcludeEmptyQueryResult(true) |
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.
you need to a new case instead of override the default value
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.
you mean new test case,right?, I have added another one,
for (RowData cachedRow : cachedRows) { | ||
collect(cachedRow); | ||
if (!cachedRows.isEmpty() || !excludeEmptyQueryResult) { | ||
for (RowData cachedRow : cachedRows) { |
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 am afraid that you should not just ignore the empty values, instead you should remove the keyRow from the cache if exlucdeEmptyQueryResult is true, and collect is still needed.
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.
Hi @wenlong88 , changes has been done, please review
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.
Hi @wenlong88 , pipeline got succeed, can you please review and merge
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.
hi, you need to add a test cover the cache changes, refer to JdbcRowDataLookupFunctionTest#testEval, on the other hands, I think it is more clearer if you do not put empty to cache in eval instead of put to cache and then invalidate.
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.
cool, got it, making changes
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.
@wenlong88 can we resolve conversations now? Also will @wuchong get it merge?
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.
@wenlong88 anything else is remaining in this?
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.
@gaurav726 the pr looks good for me now, but you still need to wait for Committers to join the review.
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.
cool, thanks for the update @wenlong88
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 can you please review my PR.
cc @wenlong88
LGTM for now, cc @wuchong |
Thanks @gaurav726 for the great work. The implementation looks good to me. However, I have some concerns about the option key. From my point of view, this issue wants to disable caching missing key (same problem with FLINK-21415). Therefore, this option key would be better to belong to |
Hi @wuchong , thanks for reviewing my PR, making changes |
Hi @wuchong , changes has been done, please review, pipeline is running, will update once success |
…via extra config option
Hi @wuchong, pipeline got succeed, please review and merge |
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.
LGTM.
… for lookup cache (apache#17754)
… for lookup cache (apache#17754) (cherry picked from commit f8fdb67)
What is the purpose of the change
Ideally, in case of cache miss for a key, or with null value fetch for key, key shouldn't be cached, however empty result query should also be in the scope, so including an extra optional parameter to configure same
Brief change log
empty check on row list will make sure for database read for empty data for the key
Verifying this change
This change is a trivial check / code fix without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation