liuyongvs commented on code in PR #3263:
URL: https://github.com/apache/calcite/pull/3263#discussion_r1241074381
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5415,6 +5415,31 @@ private static void checkIf(SqlOperatorFixture f) {
f.checkNull("array_distinct(null)");
}
+ @Test void testArrayJoinFunc() {
+ final SqlOperatorFixture f0 = fixture();
+ f0.setFor(SqlLibraryOperators.ARRAY_JOIN);
+ f0.checkFails("^array_join(array['aa', 'b', 'c'], '-')^", "No match found
for function"
+ + " signature ARRAY_JOIN\\(<CHAR\\(2\\) ARRAY>, <CHARACTER>\\)",
false);
+
+ final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.SPARK);
+ f.checkScalar("array_join(array['aa', 'b', 'c'], '-')", "aa-b-c",
+ "VARCHAR NOT NULL");
+ f.checkScalar("array_join(array[null, 'aa', null, 'b', null], '-',
'empty')",
+ "empty-aa-empty-b-empty", "VARCHAR NOT NULL");
+ f.checkScalar("array_join(array[null, 'aa', null, 'b', null], '-')",
"aa-b",
+ "VARCHAR NOT NULL");
+ f.checkScalar("array_join(array[null, x'aa', null, x'bb', null], '-')",
"aa-bb",
Review Comment:
@NobiGo
Hexadecimal Literals
https://docs.oracle.com/cd/E17952_01/mysql-8.0-en/hexadecimal-literals.html
for example: 61= 6*16+1=97, which is a
```
spark-sql (default)> select x'61';
a
```
--
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]