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

Kirill Tkalenko updated CALCITE-7837:
-------------------------------------
    Description: 
{{{}ARRAY_MIN{}}}, {{{}ARRAY_MAX{}}}, and {{SORT_ARRAY}} fail for arrays of 
{{ROW}} values, including nested rows.

Example:


{code:java}
SELECT ARRAY_MAX(ARRAY[ROW(1, 'Foo'), ROW(2, 'Bar')]);{code}
 

Expected: ROW(2, 'Bar').

Actual:

{{ClassCastException: class [Ljava.lang.Object; cannot be cast to class 
java.lang.Comparable}}
These functions require Java {{Comparable}} elements, but {{ROW}} values are 
represented as {{{}Object[]{}}}.
 

  was:
{{{}ARRAY_MIN{}}}, {{{}ARRAY_MAX{}}}, and {{SORT_ARRAY}} fail for arrays of 
{{ROW}} values, including nested rows.

Example:
{{}}
{code:java}
SELECT ARRAY_MAX(ARRAY[ROW(1, 'Foo'), ROW(2, 'Bar')]);{code}
 

Expected: ROW(2, 'Bar').

Actual:

{{ClassCastException: class [Ljava.lang.Object; cannot be cast to class 
java.lang.Comparable}}
These functions require Java {{Comparable}} elements, but {{ROW}} values are 
represented as {{{}Object[]{}}}.
 


> ARRAY_MIN, ARRAY_MAX and SORT_ARRAY throw ClassCastException for ROW elements
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-7837
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7837
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Kirill Tkalenko
>            Assignee: Kirill Tkalenko
>            Priority: Major
>
> {{{}ARRAY_MIN{}}}, {{{}ARRAY_MAX{}}}, and {{SORT_ARRAY}} fail for arrays of 
> {{ROW}} values, including nested rows.
> Example:
> {code:java}
> SELECT ARRAY_MAX(ARRAY[ROW(1, 'Foo'), ROW(2, 'Bar')]);{code}
>  
> Expected: ROW(2, 'Bar').
> Actual:
> {{ClassCastException: class [Ljava.lang.Object; cannot be cast to class 
> java.lang.Comparable}}
> These functions require Java {{Comparable}} elements, but {{ROW}} values are 
> represented as {{{}Object[]{}}}.
>  



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

Reply via email to