[
https://issues.apache.org/jira/browse/FLINK-31665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17730003#comment-17730003
]
Sergey Nuyanzin edited comment on FLINK-31665 at 6/7/23 8:40 AM:
-----------------------------------------------------------------
To be honest there is no 100% consistency across vendors.
e.g., as it was mentioned above {{ARRAY_CAT}} for snowflake and postgres
also {{ARRAY_CONCAT}} for e.g. BigQuery[1] and ClickHouse[2], DuckDB[3]
however the main difference is that these 3 vendors allow to concat arbitrary
number of arrays not just 2 (while {{ARRAY_CAT}} for mentioned above is limited
to 2 args)
Regarding your question [~twalthr]
{quote}do we have already other functions containing `CONCAT`
{quote}
there is already existing {{CONCAT}} function to concatenate strings.
And it also allows to concatenate arbitrary number(>=1) of strings.
To be consistent doesn't it make sense to go same way as BigQuery, ClickHouse,
DuckDB
like
{code:sql}
SELECT array_concat(array1, array2, ...);
{code}
?
[1]
[https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_concat]
[2]
[https://clickhouse.com/docs/en/sql-reference/functions/array-functions#arrayconcat]
[3] [https://duckdb.org/docs/sql/functions/nested.html]
was (Author: sergey nuyanzin):
To be honest there is no 100% consistency across vendors.
e.g., as it was mentioned above {{ARRAY_CAT}} for snowflake and postgres
also {{ARRAY_CONCAT}} for e.g. BigQuery[1] and ClickHouse[2], DuckDB[3]
however the main difference is that these 3 vendors allow to concat arbitrary
number of arrays not just 2 (while {{ARRAY_CAT}} for mentioned above is limited
to 2 args)
Regarding your question [~twalthr]
{quote}
do we have already other functions containing `CONCAT`
{quote}
there is already existing {{CONCAT}} function to concatenate strings.
And it also allows to concatenate arbitrary number(>=2) of strings.
To be consistent doesn't it make sense to go same way as BigQuery, ClickHouse,
DuckDB
like
{code:sql}
SELECT array_concat(array1, array2, ...);
{code}
?
[1]
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_concat
[2]
https://clickhouse.com/docs/en/sql-reference/functions/array-functions#arrayconcat
[3] https://duckdb.org/docs/sql/functions/nested.html
> Add ARRAY_CONCAT supported in SQL & Table API
> ---------------------------------------------
>
> Key: FLINK-31665
> URL: https://issues.apache.org/jira/browse/FLINK-31665
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.18.0
> Reporter: jackylau
> Assignee: Hanyu Zheng
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.18.0
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)