soumyakanti3578 commented on a change in pull request #2302:
URL: https://github.com/apache/hive/pull/2302#discussion_r644341372
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRelDecorrelator.java
##########
@@ -34,6 +34,7 @@
import javax.annotation.Nonnull;
+import org.apache.calcite.adapter.enumerable.EnumerableConvention;
Review comment:
True, I missed that!
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterJoinRule.java
##########
@@ -90,6 +90,36 @@ public boolean matches(RelOptRuleCall call) {
}
+ /**
+ * Rule that tries to push join conditions into its inputs
+ */
+ public static class HiveJoinConditionPushRule extends HiveFilterJoinRule {
Review comment:
Fixed!
##########
File path: ql/src/test/queries/clientpositive/subquery_corr_join.q
##########
@@ -0,0 +1,69 @@
+create table alltypestiny(
+id int,
+int_col int,
+bigint_col bigint,
+bool_col boolean
+);
+
+insert into alltypestiny(id, int_col, bigint_col, bool_col) values
+(1, 1, 10, true),
+(2, 4, 5, false),
+(3, 5, 15, true),
+(10, 10, 30, false);
+
+create table alltypesagg(
+id int,
+int_col int,
+bool_col boolean
+);
+
+insert into alltypesagg(id, int_col, bool_col) values
+(1, 1, true),
+(2, 4, false),
+(5, 6, true),
+(null, null, false);
+
+select *
+from alltypesagg t1
+where t1.id not in
+ (select tt1.id
+ from alltypestiny tt1 inner JOIN alltypesagg tt2
Review comment:
Added `subquery_corr_outer.q` to test LEFT JOIN
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/type/JoinCondTypeCheckProcFactory.java
##########
@@ -194,6 +207,19 @@ private ColumnInfo getColInfo(JoinTypeCheckCtx ctx, String
tabName, String colAl
}
}
+ if (cInfoToRet == null && ctx.getOuterRR() != null) {
+ for (RowResolver rr : ImmutableList.of(ctx.getOuterRR())) {
Review comment:
I cleaned this a bit now
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/type/JoinCondTypeCheckProcFactory.java
##########
@@ -104,12 +105,20 @@ private boolean hasTableAlias(JoinTypeCheckCtx ctx,
String tabName, ASTNode expr
tblAliasCnt++;
}
+ if (tblAliasCnt == 0 && ctx.getOuterRR() != null) {
Review comment:
Added a comment, and cleaned up the code 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]