gianm commented on code in PR #15511:
URL: https://github.com/apache/druid/pull/15511#discussion_r1419493299


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java:
##########
@@ -91,7 +92,6 @@ public class CalciteRulesManager
           CoreRules.AGGREGATE_PROJECT_STAR_TABLE,
           CoreRules.PROJECT_MERGE,
           CoreRules.FILTER_SCAN,
-          CoreRules.PROJECT_FILTER_TRANSPOSE,

Review Comment:
   Please update the javadoc to explain why this rule is subtracted.



##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java:
##########
@@ -224,11 +224,16 @@ public CalciteRulesManager(final 
Set<ExtensionCalciteRuleProvider> extensionCalc
   public List<Program> programs(final PlannerContext plannerContext)
   {
     // Program that pre-processes the tree before letting the full-on 
VolcanoPlanner loose.
+    List<RelOptRule> hepRules = new ArrayList<RelOptRule>(REDUCTION_RULES);
+    if (plannerContext.getJoinAlgorithm().requiresSubquery()) {
+      hepRules.add(CoreRules.FILTER_INTO_JOIN);

Review Comment:
   Could you please explain the reasoning about why we want this for 
`sortMerge`, but not for `broadcast` join? (that's essentially what 
`requiresSubquery` is checking)



##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java:
##########
@@ -194,4 +196,41 @@ public void testArrayAggQueryOnComplexDatatypes()
       );
     }
   }
+
+  @Test(timeout = 40000)
+  public void testJoinMultipleTablesWithWhereCondition()
+  {
+    testBuilder()
+        .queryContext(
+            ImmutableMap.of(
+                QueryContexts.ENABLE_DEBUG, true,

Review Comment:
   does the `ENABLE_DEBUG` need to be 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to