[ 
https://issues.apache.org/jira/browse/CALCITE-7048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yu Xu updated CALCITE-7048:
---------------------------
    Description: 
Like in https://issues.apache.org/jira/browse/CALCITE-6771

Float should convert to Double

but not support nested type like array/map.

eg:
{code:java}
"SELECT CAST(MAP[1.0,MAP[3.0,4.0]]"
    + " AS MAP<FLOAT, MAP<FLOAT, FLOAT>>)"
    + " FROM \"employee\""; {code}
current would convert to:
{code:java}
"SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
FLOAT, MAP< FLOAT, FLOAT > >)\nFROM \"foodmart\".\"employee\"" {code}
should convert to:
{code:java}
"SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
DOUBLE, MAP< DOUBLE, DOUBLE > >)\nFROM \"foodmart\".\"employee\"" {code}
 we need to fix it.

  was:
Like in https://issues.apache.org/jira/browse/CALCITE-6771

Float should convert to Double

but not support nested type like array/map.

eg:
{code:java}
"SELECT CAST(MAP[1.0,MAP[3.0,4.0]]"
    + " AS MAP<FLOAT, MAP<FLOAT, FLOAT>>)"
    + " FROM \"employee\""; {code}
current would be:
{code:java}
"SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
FLOAT, MAP< FLOAT, FLOAT > >)\nFROM \"foodmart\".\"employee\"" {code}
should convert to:
{code:java}
"SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
DOUBLE, MAP< DOUBLE, DOUBLE > >)\nFROM \"foodmart\".\"employee\"" {code}
 we need to fix it.


> The specified type conversion does not support complex types in Presto
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-7048
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7048
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.40.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.41.0
>
>
> Like in https://issues.apache.org/jira/browse/CALCITE-6771
> Float should convert to Double
> but not support nested type like array/map.
> eg:
> {code:java}
> "SELECT CAST(MAP[1.0,MAP[3.0,4.0]]"
>     + " AS MAP<FLOAT, MAP<FLOAT, FLOAT>>)"
>     + " FROM \"employee\""; {code}
> current would convert to:
> {code:java}
> "SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
> FLOAT, MAP< FLOAT, FLOAT > >)\nFROM \"foodmart\".\"employee\"" {code}
> should convert to:
> {code:java}
> "SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< 
> DOUBLE, MAP< DOUBLE, DOUBLE > >)\nFROM \"foodmart\".\"employee\"" {code}
>  we need to fix it.



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

Reply via email to