[
https://issues.apache.org/jira/browse/CALCITE-6941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-6941.
----------------------------------
Resolution: Fixed
Fixed in
https://github.com/apache/calcite/commit/d3d5f10dbaf8078970c5a0ee51271108e449649a
Thank you for your contribution [~xuzifu666]
> 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
> Labels: pull-request-available
> Fix For: 1.40.0
>
>
> Array/Map value constructor is unparsed incorrectly in ClickHouse,
> currently select map('a','b') —> select MAP['a', 'b'] select array(1,2,3)
> —> select ARRAY[1,2,3]
> *that would cause to error as follow:*
> *1. 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): ;
>
> *2. 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)
> 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)