Thomas Rebele created CALCITE-4680:
--------------------------------------
Summary: 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
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)