[
https://issues.apache.org/jira/browse/CALCITE-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17375995#comment-17375995
]
Julian Hyde edited comment on CALCITE-4680 at 7/6/21, 8:16 PM:
---------------------------------------------------------------
I see you are using the default {{SqlToRelConverter.Config}}, whose
{{isExpand()}} returns true. Does this issue arise if {{isExpand()}} is false?
I recommend setting {{expand=false}} and then using rules to decorrelate.
If there is a successful test case that combines NOT IN, correlation variables
and UNNEST, please contribute it. It's a complex case that should be part of
our suite.
was (Author: julianhyde):
I see you are using the default {{SqlToRelConverter.Config}}, whose
{{isExpand()}} returns true. Does this issue arise if {{isExpand()}} is false?
I recommend setting {{expand=false}} and then using rules to decorrelate.
> AssertionError: contains $cor1, while converting SQL query with UNNEST to
> logical plan
> --------------------------------------------------------------------------------------
>
> 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: Major
> Attachments: Calcite4680.java
>
>
> 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)