kasakrisz commented on code in PR #6082:
URL: https://github.com/apache/hive/pull/6082#discussion_r2371875517
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java:
##########
@@ -659,14 +658,17 @@ private static RexNode handleAND(RexBuilder rexBuilder,
RexCall call) {
} else {
inLHSExprToRHSExprs.put(c.exprNode, new
SimilarRexNodeElement(c.constNode));
}
- operands.remove(i);
- --i;
+ ++eqExpressionCount;
+ } else {
+ newOperands.add(operand);
}
}
+ if (inExpressionCount + eqExpressionCount ==
inLHSExprToRHSExprs.keySet().size()) {
+ // No IN and Equality expressions can be merged, bail out
+ return call;
+ }
// Create IN clauses
- final List<RexNode> newOperands = createInClauses(rexBuilder,
- visitedRefs, inLHSExprToRHSExprs, inLHSExprToRHSNullableExprs);
- newOperands.addAll(operands);
+ newOperands.addAll(createInClauses(rexBuilder, visitedRefs,
inLHSExprToRHSExprs, inLHSExprToRHSNullableExprs));
Review Comment:
Thanks for the review Denys.
AFAIK Hive doesn't have a predefined coding standard for a long time. I only
add new lines into a statement if it would be longer than 120 characters in a
single line. This was the rule when we had checkstyle in the past.
--
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]