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 2022/05/07 16:13:04 UTC

[GitHub] [calcite] dssysolyatin commented on a diff in pull request #2787: [CALCITE-5125] Extend "||" operator to work with arrays

dssysolyatin commented on code in PR #2787:
URL: https://github.com/apache/calcite/pull/2787#discussion_r867368589


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -1776,6 +1776,15 @@ protected static Calendar getCalendarNotTooNear(int timeUnit) {
     f.checkNull(" cast(null as ANY) || cast(null as ANY) ");
     f.checkString("cast('a' as varchar) || cast('b' as varchar) "
         + "|| cast('c' as varchar)", "abc", "VARCHAR NOT NULL");
+
+    f.checkScalar("array[1, 2] || array[2, 3]", "[1, 2, 2, 3]",
+        "INTEGER NOT NULL ARRAY NOT NULL");
+    f.checkScalar("array[1, 2] || array[2, null]", "[1, 2, 2, null]",
+        "INTEGER ARRAY NOT NULL");
+    f.checkScalar("array['hello', 'world'] || array['!'] || "
+            + "array[cast(null as char)]",
+        "[hello, world, !, null]", "CHAR(5) ARRAY NOT NULL");

Review Comment:
   It's impossible because array constructor should have at least one argument



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org