You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "jhonye (Jira)" <ji...@apache.org> on 2024/06/29 07:00:00 UTC
[jira] [Commented] (CALCITE-6450) Postgres CONCAT_WS function throws exception when parameter type is (, )
[ https://issues.apache.org/jira/browse/CALCITE-6450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860931#comment-17860931 ]
jhonye commented on CALCITE-6450:
---------------------------------
!image-2024-06-29-14-57-56-513.png!
In class SqlLibraryOperators show the logic, POSTGRESQL only support concat_ws(String...)
> Postgres CONCAT_WS function throws exception when parameter type is (<CHAR(1)>, <INTEGER ARRAY>)
> ------------------------------------------------------------------------------------------------
>
> Key: CALCITE-6450
> URL: https://issues.apache.org/jira/browse/CALCITE-6450
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.37.0
> Reporter: xiong duan
> Priority: Major
> Attachments: image-2024-06-29-14-57-56-513.png
>
>
> The SQL can run success in Postgres:
> {code:java}
> select concat_ws(',',ARRAY[10000, 10000, 10000, 10000]); {code}
> But in Calcite, It will throw exception:
> {code:java}
> @Test void testConcatFunction() {
> final String sql = "select concat_ws(',',ARRAY[10000, 10000, 10000, 10000]) as c";
> fixture()
> .withFactory(c ->
> c.withOperatorTable(t ->
> SqlValidatorTest.operatorTableFor(SqlLibrary.POSTGRESQL)))
> .withCatalogReader(MockCatalogReaderExtended::create)
> .withSql(sql)
> .ok();
> }{code}
> {code:java}
> From line 1, column 8 to line 1, column 55: Cannot apply 'CONCAT_WS' to arguments of type 'CONCAT_WS(<CHAR(1)>, <INTEGER ARRAY>)'. Supported form(s): 'CONCAT_WS(<STRING>)'{code}
> This issue find in comment [CALCITE-6446|https://github.com/apache/calcite/pull/3831] .
--
This message was sent by Atlassian Jira
(v8.20.10#820010)