rubenada commented on code in PR #6495:
URL: https://github.com/apache/hive/pull/6495#discussion_r3267142996
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java:
##########
@@ -259,19 +259,12 @@ private RexNode convert(ExprNodeGenericFuncDesc func)
throws SemanticException {
// If it is a floor <date> operator, we need to rewrite it
childRexNodeLst = rewriteFloorDateChildren(calciteOp, childRexNodeLst,
rexBuilder);
} else if (HiveIn.INSTANCE.equals(calciteOp) && isAllPrimitive) {
- if (childRexNodeLst.size() == 2) {
- // if it is a single item in an IN clause, transform A IN (B) to A =
B
- // from IN [A,B] => EQUALS [A,B]
- // except complex types
- calciteOp = SqlStdOperatorTable.EQUALS;
- } else if (RexUtil.isReferenceOrAccess(childRexNodeLst.get(0), true)){
- // if it is more than an single item in an IN clause,
- // transform from IN [A,B,C] => OR [EQUALS [A,B], EQUALS [A,C]]
- // except complex types
- // Rewrite to OR is done only if number of operands are less than
- // the threshold configured
- childRexNodeLst = rewriteInClauseChildren(calciteOp,
childRexNodeLst, rexBuilder);
- calciteOp = SqlStdOperatorTable.OR;
+ if (childRexNodeLst.size() == 2 ||
RexUtil.isReferenceOrAccess(childRexNodeLst.get(0), true)) {
Review Comment:
Just keeping the original logic to minimize the side effects of the change.
I'll investigate why this condition was added in the first place and whether it
can be removed...
--
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]