LB-Yu commented on code in PR #24104:
URL: https://github.com/apache/flink/pull/24104#discussion_r1463173501
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalLookupJoinRule.scala:
##########
@@ -76,8 +77,15 @@ object StreamPhysicalLookupJoinRule {
val cluster = join.getCluster
val providedTrait =
join.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
- val requiredTrait =
input.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
-
+ var requiredTrait =
input.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
+ val partitionJoinHint = join.getHints
+ .stream()
+ .filter(hint => JoinStrategy.isShuffleHashHint(hint.hintName))
+ .findFirst()
+ // if partitioning enabled, use the join key as partition key
+ if (partitionJoinHint.isPresent && !joinInfo.pairs().isEmpty) {
Review Comment:
I think there is something wrong with the way to determine whether
SHUFFLE_HASH is enabled. If I mistakenly use SHUFFLE_HASH('left_table'),
SHUFFLE_HASH will still be enabled instead of ignoring the hint. In fact, you
should at least check whether the table in hint is the right table. And this
should be reflected in the test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]