[ 
https://issues.apache.org/jira/browse/CALCITE-5570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699381#comment-17699381
 ] 

Sergey Nuyanzin edited comment on CALCITE-5570 at 3/12/23 5:59 PM:
-------------------------------------------------------------------

Thanks for the feedback

There is not much engines supporting maps which I was able to find
At least within what I found more tend to use angle brackets

*Angle* brackets for map:
     Vertica:       
[MAP|https://www.vertica.com/docs/11.0.x/HTML/Content/Authoring/SQLReferenceManual/DataTypes/MAP.htm?tocpath=SQL%20Reference%20Manual%7CSQL%20Data%20Types%7CComplex%20Types%7C_____2],
 [CAST 
examples|https://www.vertica.com/docs/11.0.x/HTML/Content/Authoring/SQLReferenceManual/DataTypes/SET.htm#Casting]
                         seems Vertica does not have a generic approach since 
it uses angle brackets for maps and square brackets for arrays
     Databricks: 
[https://docs.databricks.com/sql/language-manual/data-types/map-type.html#examples]
     Spark:         
[https://spark.apache.org/docs/latest/api/sql/index.html#typeof]
                         in Spark it is not clear from doc that it supports 
cast to map/array, looks like no. However they return result of typeof with 
angle brackets.
     Flink:           
[https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/types/#map]

*Round* for map:
     ClickHouse: [https://clickhouse.com/docs/en/sql-reference/data-types/map/]


was (Author: sergey nuyanzin):
Thanks for the feedback

There is not much engines supporting maps which I was able to find
At least within what I found more tend to use angle brackets

*Angle* brackets for map:
     Vertica:       
[https://www.vertica.com/docs/11.0.x/HTML/Content/Authoring/SQLReferenceManual/DataTypes/SET.htm#Casting]
                         seems Vertica does not have a generic approach since 
it uses angle brackets for maps and square brackets for arrays
     Databricks: 
[https://docs.databricks.com/sql/language-manual/data-types/map-type.html#examples]
     Spark:         
[https://spark.apache.org/docs/latest/api/sql/index.html#typeof]
                         in Spark it is not clear from doc that it supports 
cast to map/array, looks like no. However they return result of typeof with 
angle brackets.
     Flink:           
[https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/types/#map]

*Round* for map:
     ClickHouse: [https://clickhouse.com/docs/en/sql-reference/data-types/map/]

> Support nested map type for SqlDataTypeSpec
> -------------------------------------------
>
>                 Key: CALCITE-5570
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5570
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Sergey Nuyanzin
>            Assignee: Jiajun Xie
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> There was added a similar support for arrays/multisets at 
> https://issues.apache.org/jira/browse/CALCITE-3250
> however there is no support for maps so far.
> The issue is to add such support.
>  
> I think I'd like to clarify is syntax for maps since it has 2 internal 
> subtypes for keys and values may be something similar to ROW with delimiter 
> like
> {code:sql}
> SELECT CAST(NULL AS MAP(INT, INT));
> -- or with square brackets similar to map constructor
> SELECT CAST(NULL AS MAP[INT, INT]);
> -- or with angle (Flink syntax)
> SELECT CAST(NULL AS MAP<INT, INT>);
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to