-
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-28848][table-planner] Introduces LOOKUP join hint to support delayed retry for lookup join (table alias unsupported in hint) #20482
Conversation
6526216
to
ac69d96
Compare
rebased master and updated the pr |
partialCachingLookupProvider.getCache(), | ||
partialCachingLookupProvider.createAsyncLookupFunction()); | ||
asyncLookupFunctions = | ||
new CachingAsyncLookupFunction( |
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.
this function should be refactored to create nested delegators of user lookup func
[CachingLookupFunction]
|
[RetryableLookupFunctionDelegator]
|
userLookupFunc
I'll update 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.
Thanks for the contribution @lincoln-lil , I left some comments, and could you add some hint propagation tests ?
LookupJoinHintSpec joinHintSpec, | ||
boolean upsertMaterialize) { | ||
// async & sync lookup candidates | ||
Tuple2<UserDefinedFunction, UserDefinedFunction> lookupFunctions = new Tuple2<>(); |
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.
introduce a new class to represent the functions, which is more clear and readable
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.
ok, will add a private static class LookupFunctionCandidates
@@ -543,6 +554,201 @@ class LookupJoinTest(legacyTableSource: Boolean) extends TableTestBase with Seri | |||
util.verifyExecPlan(sql) | |||
} | |||
|
|||
@Test | |||
def testInvalidJoinHint(): Unit = { |
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 add some tests which hints refers an inner table name
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.
ok
@@ -179,6 +181,9 @@ public abstract class CommonExecLookupJoin extends ExecNodeBase<RowData> | |||
@JsonProperty(FIELD_NAME_INPUT_CHANGELOG_MODE) | |||
private final ChangelogMode inputChangelogMode; | |||
|
|||
@JsonProperty(FIELD_NAME_JOIN_HINT) | |||
private final @Nullable LookupJoinHintSpec joinHintSpec; |
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.
ignore if joinHintSpec is null
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.
ok
|JOIN LookupTable FOR SYSTEM_TIME AS OF T.proctime AS D | ||
| ON T.a = D.id | ||
|""".stripMargin, | ||
"Invalid LOOKUP hint options, parsing error: Could not parse value 'yes' for key 'async'", |
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.
parsing error
will cause misunderstanding, just remove it
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.
will change to "Invalid LOOKUP hint options: Could not..."
private final Long asyncTimeout; | ||
|
||
@JsonProperty(FIELD_NAME_RETRY_PREDICATE) | ||
private final @Nullable String retryPredicate; |
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.
ignore empty: @JsonInclude(JsonInclude.Include.NON_NULL)
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.
@godfreyhe thanks for reviewing this! I'll update the pr according to your comments
@@ -179,6 +181,9 @@ public abstract class CommonExecLookupJoin extends ExecNodeBase<RowData> | |||
@JsonProperty(FIELD_NAME_INPUT_CHANGELOG_MODE) | |||
private final ChangelogMode inputChangelogMode; | |||
|
|||
@JsonProperty(FIELD_NAME_JOIN_HINT) | |||
private final @Nullable LookupJoinHintSpec joinHintSpec; |
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.
ok
LookupJoinHintSpec joinHintSpec, | ||
boolean upsertMaterialize) { | ||
// async & sync lookup candidates | ||
Tuple2<UserDefinedFunction, UserDefinedFunction> lookupFunctions = new Tuple2<>(); |
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.
ok, will add a private static class LookupFunctionCandidates
@@ -543,6 +554,201 @@ class LookupJoinTest(legacyTableSource: Boolean) extends TableTestBase with Seri | |||
util.verifyExecPlan(sql) | |||
} | |||
|
|||
@Test | |||
def testInvalidJoinHint(): Unit = { |
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.
ok
|JOIN LookupTable FOR SYSTEM_TIME AS OF T.proctime AS D | ||
| ON T.a = D.id | ||
|""".stripMargin, | ||
"Invalid LOOKUP hint options, parsing error: Could not parse value 'yes' for key 'async'", |
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.
will change to "Invalid LOOKUP hint options: Could not..."
09cbf8a
to
06da0fb
Compare
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
…elayed retry for lookup join (table alias unsupported in hint) This is the main part of FLINK-28779 to implement FLIP-234: Support Retryable Lookup Join To Solve Delayed Updates Issue In External Systems
…on type instead of one-level parent class compartion in LookupJoinCodeGenerator This bug can be reproduced by AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithInsufficientRetry when caching is disabled in FLINK-28849
…retry timer to prevent unexpected incomplete element during finish phase in AsyncWaitOperator It is hard to reproduce this in runtime tests, but occasionally happens in AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithSufficientRetry of FLINK-28849. It's better to add a separte test in runtime.
…okup and add more tests
6f7e54f
to
b6daeb6
Compare
@flinkbot run azure |
@flinkbot run azure |
there're several merge conflicts for the latest master, so need to verify the merged pr completely, the local verify is running now |
…on type instead of one-level parent class compartion in LookupJoinCodeGenerator This bug can be reproduced by AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithInsufficientRetry when caching is disabled in FLINK-28849 This closes #20482
…retry timer to prevent unexpected incomplete element during finish phase in AsyncWaitOperator It is hard to reproduce this in runtime tests, but occasionally happens in AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithSufficientRetry of FLINK-28849. It's better to add a separate test in runtime. This closes #20482
…okup and add more tests Disable retry on async because of two problems need to be resolved first This closes #20482
…elayed retry for lookup join (table alias unsupported in hint) This is the main part of FLINK-28779 to implement FLIP-234: Support Retryable Lookup Join To Solve Delayed Updates Issue In External Systems This closes apache#20482
…on type instead of one-level parent class compartion in LookupJoinCodeGenerator This bug can be reproduced by AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithInsufficientRetry when caching is disabled in FLINK-28849 This closes apache#20482
…retry timer to prevent unexpected incomplete element during finish phase in AsyncWaitOperator It is hard to reproduce this in runtime tests, but occasionally happens in AsyncLookupJoinITCase#testAsyncJoinTemporalTableWithLookupThresholdWithSufficientRetry of FLINK-28849. It's better to add a separate test in runtime. This closes apache#20482
…okup and add more tests Disable retry on async because of two problems need to be resolved first This closes apache#20482
What is the purpose of the change
Introduces LOOKUP join hint to support delayed retry for lookup join (table alias unsupported in hint)
This is the main part of FLINK-28779 to implement FLIP-234: Support Retryable Lookup Join To Solve Delayed Updates Issue In External Systems.
The join hint based on [FLINK-28682][table-planner] support join hint in batch rules #20359, and adds a new hint 'LOOKUP' described in FLIP-234.
Brief change log
Verifying this change
Does this pull request potentially affect one of the following parts:
Documentation