lincoln-lil commented on code in PR #20697:
URL: https://github.com/apache/flink/pull/20697#discussion_r957058728
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/hints/batch/JoinHintTestBase.java:
##########
@@ -384,7 +384,32 @@ public void testJoinHintWithoutAffectingJoinInView() {
}
@Test
- public void testJoinHintWithoutAffectingJoinInSubQuery() {
+ public void testJoinHintWithoutAffectingJoinInView2() {
Review Comment:
nit: the case name can be more meaningful
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/hints/batch/JoinHintTestBase.java:
##########
@@ -384,7 +384,32 @@ public void testJoinHintWithoutAffectingJoinInView() {
}
@Test
- public void testJoinHintWithoutAffectingJoinInSubQuery() {
+ public void testJoinHintWithoutAffectingJoinInView2() {
+ // the join in V2 will use the planner's default join strategy,
+ // and the join between T1 and V2 will use BROADCAST
+ util.tableEnv()
Review Comment:
nit: the view can be reused
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/calcite/FlinkPlannerImpl.scala:
##########
@@ -193,17 +193,24 @@ class FlinkPlannerImpl(
private def rel(validatedSqlNode: SqlNode, sqlValidator:
FlinkCalciteSqlValidator) = {
try {
assert(validatedSqlNode != null)
- val sqlToRelConverter: SqlToRelConverter =
createSqlToRelConverter(sqlValidator)
-
// check whether this SqlNode tree contains join hints
val checkContainJoinHintShuttle = new CheckContainJoinHintShuttle
validatedSqlNode.accept(checkContainJoinHintShuttle)
- checkContainJoinHintShuttle.containsJoinHint
-
- // TODO currently, it is a relatively hacked way to tell converter
- // that this SqlNode tree contains join hints
- if (checkContainJoinHintShuttle.containsJoinHint) {
- sqlToRelConverter.containsJoinHint()
+ val sqlToRelConverter: SqlToRelConverter = if
(checkContainJoinHintShuttle.containsJoinHint) {
+ val converter = createSqlToRelConverter(
+ sqlValidator,
+ // disable project merge
Review Comment:
simplify it to "disable project merge during sql to rel phase to prevent
incorrect propagation of join hints into child query block" ?
--
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]