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

 ##########
 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:
   Tbh that method follows same contract as all other `RexConverter` methods. I 
see the value on what you are suggesting, since with a better contract, those 
methods could be easily called from within rules, etc. Since we will address 
the `RexConverter` refactoring in HIVE-23227, I have moved this method to 
`RexConverter` and I have left an additional reminder in the JIRA:
   
https://issues.apache.org/jira/browse/HIVE-23227?focusedCommentId=17085421&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17085421

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