You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/08/31 10:18:41 UTC

[GitHub] [calcite] liyafan82 commented on a change in pull request #2124: [CALCITE-4173] Add internal SEARCH operator and Sarg literal that represents a set of values or ranges

liyafan82 commented on a change in pull request #2124:
URL: https://github.com/apache/calcite/pull/2124#discussion_r480031532



##########
File path: core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
##########
@@ -737,25 +745,24 @@ public SqlNode toSql(RexProgram program, RexNode rex) {
         return new SqlDynamicParam(caseParam.getIndex(), POS);
 
       case IN:
-        if (rex instanceof RexSubQuery) {
-          subQuery = (RexSubQuery) rex;
-          sqlSubQuery =
-              implementor().visitRoot(subQuery.rel).asQueryOrValues();
-          final List<RexNode> operands = subQuery.operands;
-          SqlNode op0;
-          if (operands.size() == 1) {
-            op0 = toSql(program, operands.get(0));
-          } else {
-            final List<SqlNode> cols = toSql(program, operands);
-            op0 = new SqlNodeList(cols, POS);
-          }
-          return subQuery.getOperator().createCall(POS, op0, sqlSubQuery);
+        subQuery = (RexSubQuery) rex;

Review comment:
       For scenarios which is not a in-sub-query, this may cause a ClassCastException?




----------------------------------------------------------------
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:
users@infra.apache.org