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

Ruben Q L commented on CALCITE-4064:
------------------------------------

[~julianhyde], I am trying to work on a solution for this issue. Maybe you can 
help me to understand the following: why was it decided that Uncollect (and 
FlatList) needed to return ComparableList? (see CALCITE-855). In the scenario 
of this bug (array within an array), this seems a limitation.

> Unnest on array with nested structs causes ArrayStoreException
> --------------------------------------------------------------
>
>                 Key: CALCITE-4064
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4064
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.23.0
>            Reporter: Ruben Q L
>            Priority: Major
>
> Maybe related to CALCITE-4063.
> The problem can be reproduced by running the following query:
> {code:sql}
> select * from UNNEST(array[ROW(1, ROW(5, 10)), ROW(2, ROW(6, 12))])
> {code}
> Which fails with:
> {code}
> java.lang.ArrayStoreException
>       at java.lang.System.arraycopy(Native Method)
>       at 
> org.apache.calcite.runtime.SqlFunctions$ProductComparableListEnumerator.current(SqlFunctions.java:2837)
>       at 
> org.apache.calcite.runtime.SqlFunctions$ProductComparableListEnumerator.current(SqlFunctions.java:2804)
>       at 
> org.apache.calcite.linq4j.EnumerableDefaults$17$1.current(EnumerableDefaults.java:2619)
>       at 
> org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.next(Linq4j.java:684)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to