ILuffZhe commented on code in PR #3258:
URL: https://github.com/apache/calcite/pull/3258#discussion_r1231650729


##########
core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java:
##########
@@ -149,6 +151,24 @@ static <E> List<E> list() {
     assertThat(concatWithNull(null, "b"), is("b"));
   }
 
+  @Test void testConcatMulti() {
+    assertThat(concatMulti("a b", "cd", "e"), is("a bcde"));
+    // The code generator will ensure that nulls are never passed in. If we
+    // pass in null, it is treated like the string "null", as the following
+    // tests show. Not the desired behavior for SQL.
+    assertThat(concatMulti((String) null), is("null"));
+    assertThat(concatMulti((String) null, null), is("nullnull"));
+    assertThat(concatMulti("a", null, "b"), is("anullb"));
+  }
+
+  @Test void testConcatMultiWithNull() {
+    assertThat(concatMultiWithNull("a b", "cd", "e"), is("a bcde"));
+    // Null value could be passed in which is treated as empty string.
+    assertThat(concatMultiWithNull((String) null), is(""));

Review Comment:
   For BigQuery, you should see testConcatMulti(), and you are right about the 
behavior.(but the code generator will ensure nulls won't be passed in)
   testConcatMultiWithNull() is a test for CONCAT function that enabled in 
Postgresql and MSSQL.



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