YiwenWu commented on code in PR #3846:
URL: https://github.com/apache/calcite/pull/3846#discussion_r1667904970
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -1089,6 +1090,25 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding
operatorBinding,
SqlFunctionCategory.STRING)
.withOperandTypeInference(InferTypes.RETURN_TYPE);
+ /** The "CONCAT_WS(separator, arg1, ...)" function (Postgres).
+ *
+ * <p>Differs from {@link #CONCAT_WS} (MySQL) in that its arg1 can be of any
type,
+ * not limited to string. For example:
+ *
+ * <ul>
+ * <li>{@code CONCAT_WS(',', 'a')} returns "{@code a}";
Review Comment:
@NobiGo Yes, it's handled differently. Spark will append each element of the
array, Postgres directly toString and then append.
Spark:
```
select concat_ws(',',ARRAY[1000, 2000]);
1000,2000
```
Postgres:
```
select concat_ws(',',ARRAY[1000, 2000]);
{10000,2000}
```
--
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]