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

Vladislav Pyatkov reassigned CALCITE-7919:
------------------------------------------

    Assignee: Vladislav Pyatkov

> Multi-column ORDER BY fails for ARRAY
> -------------------------------------
>
>                 Key: CALCITE-7919
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7919
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Vladislav Pyatkov
>            Assignee: Vladislav Pyatkov
>            Priority: Major
>              Labels: pull-request-available
>
> The following query fails because the generated comparator casts an ARRAY 
> value to {{Comparable}}:
> {code:sql}
> SELECT id
> FROM (
>   VALUES
>     (1, ARRAY[2, 0]),
>     (2, ARRAY[1, 2]),
>     (3, ARRAY[1, 1])
> ) AS t(id, k)
> ORDER BY k, id;
> {code}
> Expected result: {{3, 2, 1}}.
> Actual error:
> {noformat}
> java.lang.ClassCastException:
> class java.util.ArrayList cannot be cast to class java.lang.Comparable
> {noformat}
> Sorting by {{k}} alone works correctly, but sorting by multiple columns 
> ({{ORDER BY k, id}}) fails with an exception.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to