xuyangzhong commented on code in PR #23620:
URL: https://github.com/apache/flink/pull/23620#discussion_r1384561374


##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java:
##########
@@ -216,18 +213,12 @@ public static RelNode decorrelateQuery(RelNode rootRel, 
RelBuilder relBuilder) {
             newRootRel = decorrelator.decorrelate(newRootRel);
         }
 
-        // Re-propagate the hints.
-        newRootRel = RelOptUtil.propagateRelHints(newRootRel, true);
-
         // ----- FLINK MODIFICATION BEGIN -----
+        // REASON: hints are already parsed and validated before optimizing, 
so should not
+        // re-propagate again here
 
-        // replace all join hints with upper case
-        newRootRel = FlinkHints.capitalizeJoinHints(newRootRel);
-
-        // clear join hints which are propagated into wrong query block
-        // The hint QueryBlockAlias will be added when building a RelNode tree 
before. It is used to
-        // distinguish the query block in the SQL.
-        newRootRel = newRootRel.accept(new 
ClearJoinHintWithInvalidPropagationShuttle());
+        // Re-propagate the hints.
+        // newRootRel = RelOptUtil.propagateRelHints(newRootRel, true);

Review Comment:
   I think it's better to keep the comments on this place because the original 
class `RelDecorrelator` in calcite has the code in Line-221. And we should 
leave the reason why we remove the propagation here.



-- 
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]

Reply via email to