You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "liuyongvs (via GitHub)" <gi...@apache.org> on 2023/04/18 23:38:51 UTC

[GitHub] [calcite] liuyongvs commented on a diff in pull request #3161: [CALCITE-5657] Add ARRAY_DISTINCT function (enabled in Spark library).

liuyongvs commented on code in PR #3161:
URL: https://github.com/apache/calcite/pull/3161#discussion_r1170666492


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5167,6 +5167,18 @@ private static void checkIf(SqlOperatorFixture f) {
     f.checkNull("array_concat(cast(null as integer array), array[1])");
   }
 
+  /** Tests {@code ARRAY_DISTINCT} function from Spark. */
+  @Test void testArrayDistinctFunc() {
+    SqlOperatorFixture f = fixture()
+        .setFor(SqlLibraryOperators.ARRAY_DISTINCT)
+        .withLibrary(SqlLibrary.SPARK);
+    f.checkScalar("array_distinct(array[1, 2, 2, 1])", "[1, 2]",
+        "INTEGER NOT NULL ARRAY NOT NULL");
+    f.checkScalar("array_distinct(array[null, 1, null])", "[null, 1]",
+        "INTEGER ARRAY NOT NULL");
+    f.checkNull("array_distinct(null)");
+  }

Review Comment:
   why need this, it is the same. unit tests need to be carefully selected



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