NobiGo commented on code in PR #4345:
URL: https://github.com/apache/calcite/pull/4345#discussion_r2065219674


##########
core/src/main/java/org/apache/calcite/rex/RexBuilder.java:
##########
@@ -1874,6 +1874,7 @@ && areAssignable(arg, Arrays.asList(lower, upper))) {
       return literal.getValueAs(clazz);
 
     case ROW:
+    case ARRAY_VALUE_CONSTRUCTOR:

Review Comment:
   Shouldn't we also incorporate `MULTISET_VALUE_CONSTRUCTOR` to support 
`MULTISET`?



##########
core/src/test/java/org/apache/calcite/rex/RexBuilderTest.java:
##########
@@ -960,6 +960,22 @@ private void checkDate(RexLiteral literal) {
     assertThat(inCall.getKind(), is(SqlKind.SEARCH));
   }
 
+  @Test void testMakeInWithArrayLiterals() {
+    RelDataTypeFactory typeFactory = new 
SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
+    RexBuilder rexBuilder = new RexBuilder(typeFactory);
+    RelDataType intType = typeFactory.createSqlType(SqlTypeName.INTEGER);
+    RelDataType arrayIntType = typeFactory.createArrayType(intType, -1);
+    RexNode column = rexBuilder.makeInputRef(arrayIntType, 0);
+    RexNode l1 = rexBuilder.makeLiteral(ImmutableList.of(100, 200), 
arrayIntType, false);
+    RexNode l2 = rexBuilder.makeLiteral(ImmutableList.of(300, 400), 
arrayIntType, false);
+    RexNode inCall = rexBuilder.makeIn(column, ImmutableList.of(l1, l2));
+    assertThat(
+        inCall, hasToString("SEARCH($0, Sarg["
+        + "[100:INTEGER, 200:INTEGER]:INTEGER NOT NULL ARRAY, "

Review Comment:
   If NULL is maintained as uniform, the output here should be `INTEGER NOT 
NULL ARRAY NOT NULL`, which is more explicit.



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

Reply via email to