mdayakar commented on code in PR #6055: URL: https://github.com/apache/hive/pull/6055#discussion_r2321279664
########## ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java: ########## @@ -1272,6 +1272,28 @@ public static boolean hasAllExpressionsFromRightSide(RelNode joinRel, List<RexNo return true; } + /** + * Checks the operands in the join conditions are from right table or only from left table. + * + * @param joinRel Join node + * @return true if the join condition operands are from right and left table, false otherwise. + */ + public static boolean hasJoinConditionOperandFromRightTable(Join joinRel) { + RexNode condition = joinRel.getCondition(); + RelNode leftRel = joinRel.getLeft(); + int leftFieldCount = leftRel.getRowType().getFieldCount(); + ImmutableBitSet leftBitmap = ImmutableBitSet.range(leftFieldCount); + List<RexNode> conditions = RelOptUtil.conjunctions(condition); + for (RexNode cond : conditions) { + ImmutableBitSet condBitmap = RelOptUtil.InputFinder.bits(cond); + // if condition becomes true if both the operands are from left table Review Comment: Modified the comment -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org