You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mihai Budiu (Jira)" <ji...@apache.org> on 2025/06/05 07:35:00 UTC
[jira] [Commented] (CALCITE-7048) The specified type conversion does not support complex types in Presto
[ https://issues.apache.org/jira/browse/CALCITE-7048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956277#comment-17956277 ]
Mihai Budiu commented on CALCITE-7048:
--------------------------------------
This issue title needs some work. "specified type conversion" is vague.
You mean that the code generation for the Presto dialect for types involving Float is incorrect.
And this is not a "major" bug by any means.
> 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
>
>
> In https://issues.apache.org/jira/browse/CALCITE-6771 Float should convert to Double,But it has not been completely solved. Currently, it does not support conversion of complex types such as map/array.
> 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}
>
> *test them in presto env:*
> {code:java}
> presto> SELECT CAST(MAP (ARRAY[1.0], ARRAY[MAP (ARRAY[3.0], ARRAY[4.0])]) AS MAP< DOUBLE, MAP< DOUBLE, DOUBLE > >);
> _col0
> -----------------
> {1.0={3.0=4.0}}
> (1 row)Query 20250603_014324_07282_cqcdm, FINISHED, 1 node
> Splits: 17 total, 17 done (100.00%)
> [Latency: client-side: 72ms, server-side: 29ms] [0 rows, 0B] [0 rows/s, 0B/s]
> presto> SELECT CAST(ARRAY[ARRAY[1.0], ARRAY[2.0], ARRAY[3.0]] AS DOUBLE ARRAY ARRAY);
> _col0
> -----------------------
> [[1.0], [2.0], [3.0]]
> (1 row)Query 20250603_014346_07324_cqcdm, FINISHED, 1 node
> Splits: 17 total, 17 done (100.00%)
> [Latency: client-side: 102ms, server-side: 90ms] [0 rows, 0B] [0 rows/s, 0B/s] {code}
> confirm that presto support map/array cast.
> so we need to fix it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)