ILuffZhe commented on code in PR #4431:
URL: https://github.com/apache/calcite/pull/4431#discussion_r2160577068
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -2565,6 +2568,17 @@ private static void checkConcatFunc(SqlOperatorFixture
f) {
f.checkString("concat('', '', 'a')", "a", "VARCHAR(1) NOT NULL");
f.checkString("concat('', '', '')", "", "VARCHAR(0) NOT NULL");
f.checkFails("^concat()^", INVALID_ARGUMENTS_NUMBER, false);
+
+ // test for ByteString
+ f.checkString("concat(x'61',x'62')", "0x6162", "VARCHAR(2) NOT NULL");
+ f.checkString("concat(cast(x'61' as binary), cast(x'62' as binary), "
+ + "cast(x'63' as binary))", "0x616263", "VARCHAR(3) NOT NULL");
Review Comment:
Why is it VARCHAR(3)?
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -1651,8 +1651,31 @@ public static ByteString concat(ByteString s0,
ByteString s1) {
}
/** SQL {@code CONCAT(arg0, arg1, arg2, ...)} function. */
- public static String concatMulti(String... args) {
- return String.join("", args);
+ public static String concatMulti(Object... args) {
Review Comment:
This function is also enabled in BIG_QUERY, do they behave the same?
--
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]