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

Julian Hyde commented on CALCITE-1518:
--------------------------------------

I see it too. It gives the following stack.

{noformat}
java.lang.ArrayIndexOutOfBoundsException: -1

        at java.util.ArrayList.elementData(ArrayList.java:418)
        at java.util.ArrayList.get(ArrayList.java:431)
        at 
org.apache.calcite.sql.validate.SelectNamespace.getMonotonicity(SelectNamespace.java:73)
        at 
org.apache.calcite.sql.SqlIdentifier.getMonotonicity(SqlIdentifier.java:369)
        at 
org.apache.calcite.sql.SqlCallBinding.getOperandMonotonicity(SqlCallBinding.java:193)
        at 
org.apache.calcite.sql.SqlAsOperator.getMonotonicity(SqlAsOperator.java:139)
        at org.apache.calcite.sql.SqlCall.getMonotonicity(SqlCall.java:180)
        at 
org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:3492)
{noformat}

It's definitely a bug. It might have something to do with you using an 
anonymous record type. I don't know whether this problem would occur if you 
used a type. (Granted, there is no way through SQL or via a JSON model to 
create a record type, but see MockCatalogReader.addressType and the tests that 
use it.)

> Converting SELECT table.nested.field FROM (...) to RelNode throws 
> ArrayIndexOutOfBoundsException
> ------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1518
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1518
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.0
>            Reporter: George Fraser
>            Assignee: Julian Hyde
>
> See 
> https://github.com/georgewfraser/calcite/commit/0c13c1b45f085018ca6992df6b66ee62d4f873cb
>  for test case SqlToRelConverterTest#testSelectNestedFromSubquery



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to