You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Yu Xu (Jira)" <ji...@apache.org> on 2025/04/07 02:26:00 UTC
[jira] [Updated] (CALCITE-6941) Array/Map value constructor is unparsed incorrectly in ClickHouse
[ https://issues.apache.org/jira/browse/CALCITE-6941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yu Xu updated CALCITE-6941:
---------------------------
Description:
Array/Map value constructor is unparsed incorrectly in ClickHouse, as follow:
*1. case sensitive with map/array:*
select map('a', 'b');
*> \{'a':'b'} ----- result is ok*
select MAP('a', 'b');
Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `MAP` does not exist. In scope SELECT MAP('a', 'b').
Maybe you meant: ['map','max']. (UNKNOWN_FUNCTION)
select array(1,2);
*> [1,2] ----- result is ok*
select ARRAY(1,2);
Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `ARRAY` does not exist. In scope SELECT ARRAY(1, 2).
Maybe you meant: ['array']. (UNKNOWN_FUNCTION)
*2. array[1,2,3] should to be array(1,2,3) and map['k1','v1','k2','v2'] should be map('k1','v1','k2','v2')*
select array[1,2];
Code: 62. DB::Exception: Syntax error: failed at position 294 (end of query) (line 16, col 18): ;
select map['k1','v1','k2','v2'];
Code: 62. DB::Exception: Syntax error: failed at position 330 (end of query) (line 17, col 32): ;
above results can refer to doc:
[https://clickhouse.com/docs/sql-reference/data-types/array]
[https://clickhouse.com/docs/sql-reference/data-types/map]
was:
Array/Map value constructor is unparsed incorrectly in ClickHouse, as follow:
*1. case sensitive with map/array:*
select map('a', 'b');
> \{'a':'b'} ----- result is ok
select MAP('a', 'b');
Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `MAP` does not exist. In scope SELECT MAP('a', 'b').
Maybe you meant: ['map','max']. (UNKNOWN_FUNCTION)
select array(1,2);
> [1,2] ----- result is ok
select ARRAY(1,2);
Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `ARRAY` does not exist. In scope SELECT ARRAY(1, 2).
Maybe you meant: ['array']. (UNKNOWN_FUNCTION)
*2. array[1,2,3] should to be array(1,2,3) and map['k1','v1','k2','v2'] should be map('k1','v1','k2','v2')*
select array[1,2];
Code: 62. DB::Exception: Syntax error: failed at position 294 (end of query) (line 16, col 18): ;
select map['k1','v1','k2','v2'];
Code: 62. DB::Exception: Syntax error: failed at position 330 (end of query) (line 17, col 32): ;
above results can refer to doc:
https://clickhouse.com/docs/sql-reference/data-types/array
https://clickhouse.com/docs/sql-reference/data-types/map
> Array/Map value constructor is unparsed incorrectly in ClickHouse
> -----------------------------------------------------------------
>
> Key: CALCITE-6941
> URL: https://issues.apache.org/jira/browse/CALCITE-6941
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.39.0
> Reporter: Yu Xu
> Assignee: Yu Xu
> Priority: Major
> Fix For: 1.40.0
>
>
> Array/Map value constructor is unparsed incorrectly in ClickHouse, as follow:
> *1. case sensitive with map/array:*
> select map('a', 'b');
> *> \{'a':'b'} ----- result is ok*
> select MAP('a', 'b');
> Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `MAP` does not exist. In scope SELECT MAP('a', 'b').
> Maybe you meant: ['map','max']. (UNKNOWN_FUNCTION)
>
> select array(1,2);
> *> [1,2] ----- result is ok*
> select ARRAY(1,2);
> Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Function with name `ARRAY` does not exist. In scope SELECT ARRAY(1, 2).
> Maybe you meant: ['array']. (UNKNOWN_FUNCTION)
> *2. array[1,2,3] should to be array(1,2,3) and map['k1','v1','k2','v2'] should be map('k1','v1','k2','v2')*
> select array[1,2];
> Code: 62. DB::Exception: Syntax error: failed at position 294 (end of query) (line 16, col 18): ;
> select map['k1','v1','k2','v2'];
> Code: 62. DB::Exception: Syntax error: failed at position 330 (end of query) (line 17, col 32): ;
> above results can refer to doc:
> [https://clickhouse.com/docs/sql-reference/data-types/array]
> [https://clickhouse.com/docs/sql-reference/data-types/map]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)