Vladsz83 commented on code in PR #10910:
URL: https://github.com/apache/ignite/pull/10910#discussion_r1358280250


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerHelper.java:
##########
@@ -73,8 +75,9 @@ public static IgniteRel optimize(SqlNode sqlNode, 
IgnitePlanner planner, IgniteL
             // Convert to Relational operators graph.
             RelRoot root = planner.rel(sqlNode);
 
-            planner.setDisabledRules(HintUtils.options(root.rel, 
extractRootHints(root.rel),
-                HintDefinition.DISABLE_RULE));
+            root = addExternalHint(root, planner);
+
+            planner.setDisabledRules(HintUtils.options(root.rel, 
extractRootHints(root.rel), HintDefinition.DISABLE_RULE));

Review Comment:
   `planner.setDisabledRules()` disables rules for the whole query, including 
subqueries and unions. `HintStrategy's excludedRules` is able to just skip rule 
for certain RelNode (in `RelOptRuleCall#isRuleExcluded()`). If we process this 
hint as a disabled rules, tests like 
`testDisabledCommutingOfJoinInputsInSubquery()` or `testUnions()` won't work 
correctly. Join order will be disabled for all the joins. 



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