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

Thomas Rebele commented on CALCITE-4680:
----------------------------------------

The problem does not exist for the Quidem test files, maybe because the 
converter is configured withExpand(false).

The example allowed me to reproduce the problem using only implicit types (so 
no type factory acrobatics anymore).

> AssertionError: contains $cor1, while converting SQL query containing UNNEST 
> to logical plan using subquery expansion
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4680
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4680
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.27.0
>            Reporter: Thomas Rebele
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: Calcite4680.java
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The exception happens with the following SQL query
> {code:java}
> SELECT field1 FROM tab t1
> WHERE t1.field1 NOT IN (
>       SELECT l.subfield
>       FROM tab t2, UNNEST(t2.field2) AS l
>       WHERE t1.field1 = t2.field1)
> {code}
> and the schema
> {code:java}
> RecordType(VARCHAR NOT NULL field1, RecordType(VARCHAR subfield) ARRAY field2)
> {code}
> (where field2.subfield is nullable). Previous versions of Calcite threw a 
> ClassCastException: LogicalCorrelate cannot be cast to Join.
> However, it passes after removing the WHERE clause of the subquery.



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

Reply via email to