caicancai commented on code in PR #3706:
URL: https://github.com/apache/calcite/pull/3706#discussion_r1503698681


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -6268,6 +6268,18 @@ void checkRegexpExtract(SqlOperatorFixture f0, 
FunctionAlias functionAlias) {
     f.checkScalar("rand_integer(2, 11)", 1, "INTEGER NOT NULL");
   }
 
+  /** Test case for <a 
href="https://issues.apache.org/jira/browse/CALCITE-6283";>
+   * [CALCITE-6283] Function array_append with a NULL array argument crashes 
with
+   * NullPointerException</a>. */
+  @Test void testArrayNullFunc() {
+    final SqlOperatorFixture f = fixture().withLibrary(SqlLibrary.SPARK);
+    f.checkNull("array_append(null, 2)");
+    f.checkNull("array_prepend(null, 2)");
+    f.checkNull("array_remove(null, 2)");
+    f.checkNull("array_contains(null, 2)");

Review Comment:
   What I mean is that spark3.4 version does not support array_append(null, 1), 
it will report an error. Currently, array_append and array_prepend are adapted 
for spark in calcite. If spark does not support array_append(null , 1), why do 
we need to return null? I am not sure whether higher versions of spark support 
it.
   I don't know if my opinion is useful, if it is problematic, please ignore 
it. But I still want to express my opinion. This is open source, thank you.
   
![捕获](https://github.com/apache/calcite/assets/77189278/dfefad4e-45d0-431a-a55c-df340878ba16)
   
   



-- 
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-unsubscr...@calcite.apache.org

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

Reply via email to