soumyava commented on code in PR #15302:
URL: https://github.com/apache/druid/pull/15302#discussion_r1392882935


##########
sql/src/main/java/org/apache/druid/sql/calcite/rule/JoinRules.java:
##########
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.sql.calcite.rule;

Review Comment:
   The logic in here has been moved to DruidJoinRule this can be deleted



##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:
##########
@@ -723,7 +723,7 @@ public void 
testFilterAndGroupByLookupUsingJoinOperatorBackwards(Map<String, Obj
                                 ),
                                 "j0.",
                                 equalsCondition(makeColumnExpression("k"), 
makeColumnExpression("j0.dim2")),
-                                JoinType.RIGHT
+                                JoinType.INNER

Review Comment:
   Same comment as before, we are converting a right join to an inner join here 
and that are changing the expected results



##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:
##########
@@ -768,7 +762,7 @@ public void 
testFilterAndGroupByLookupUsingJoinOperatorWithNotFilter(Map<String,
                                 new LookupDataSource("lookyloo"),
                                 "j0.",
                                 equalsCondition(makeColumnExpression("dim2"), 
makeColumnExpression("j0.k")),
-                                JoinType.LEFT
+                                JoinType.INNER

Review Comment:
   Same as before



##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java:
##########
@@ -772,7 +772,7 @@ public void testJoinWithLookup()
                                                
DruidExpression.ofColumn(ColumnType.STRING, "dim2"),
                                                
DruidExpression.ofColumn(ColumnType.STRING, "j0.k")
                                            ),
-                                           JoinType.LEFT
+                                           JoinType.INNER

Review Comment:
   The initial query has a left join here and we end up planning it as in 
inner. Can there be a case where the user does not expect the results which 
have a pair on both left and right ? Also that seems to be case where the 
result changed for the not sql compatible mode



##########
sql/src/test/java/org/apache/druid/sql/calcite/DecoupledPlanningCalciteQueryTest.java:
##########
@@ -53,4 +53,5 @@ public SqlTestFramework.PlannerFixture 
plannerFixture(PlannerConfig plannerConfi
         .cannotVectorize(cannotVectorize)
         .skipVectorize(skipVectorize);
   }
+

Review Comment:
   nit. remove this line



##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java:
##########
@@ -821,7 +809,7 @@ public void testJoinUnionTablesOnLookup(Map<String, Object> 
queryContext)
                                 new LookupDataSource("lookyloo"),
                                 "j0.",
                                 equalsCondition(makeColumnExpression("dim2"), 
makeColumnExpression("j0.k")),
-                                JoinType.LEFT
+                                JoinType.INNER

Review Comment:
   Similar comment as the previous one



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