kgyrtkirk commented on a change in pull request #970: Hive 23100
URL: https://github.com/apache/hive/pull/970#discussion_r408767582
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/jdbc/JDBCExpandExpressionsRule.java
 ##########
 @@ -196,24 +197,11 @@ private RexNode transformIntoOrAndClause(RexBuilder 
rexBuilder, RexCall expressi
         return expression;
       }
 
-      final List<RexNode> disjuncts = new 
ArrayList<>(expression.getOperands().size() - 2);
-      final RexCall columnExpressions = (RexCall) 
expression.getOperands().get(0);
-      for (int i = 1; i < expression.getOperands().size(); i++) {
-        List<RexNode> conjuncts = new 
ArrayList<>(columnExpressions.getOperands().size() - 1);
-        RexCall valueExpressions = (RexCall) expression.getOperands().get(i);
-        for (int j = 0; j < columnExpressions.getOperands().size(); j++) {
-          conjuncts.add(rexBuilder.makeCall(
-              SqlStdOperatorTable.EQUALS,
-              columnExpressions.getOperands().get(j),
-              valueExpressions.getOperands().get(j)));
-        }
-        if (conjuncts.size() > 1) {
-          disjuncts.add(rexBuilder.makeCall(
-              SqlStdOperatorTable.AND,
-              conjuncts));
-        } else {
-          disjuncts.add(conjuncts.get(0));
-        }
+      final List<RexNode> disjuncts = HiveCalciteUtil.transformIntoOrAndClause(
 
 Review comment:
   I believe this call should get the "expression" as argument not it's 
operands - that way the HiveCalciteUtil.tIOA method would have better contract 
- it seems like this callsite removes cases when there is a struct on the 
lefthandside - I believe that decision should be made by the utility method
   ...and then the OR will be created inside that method as well...it will be 
more straight forward

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to