[
https://issues.apache.org/jira/browse/CALCITE-4833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130300#comment-18130300
]
Vladimir Sitnikov commented on CALCITE-4833:
--------------------------------------------
The query from the description, {{SELECT t1.empid FROM emps t1 LEFT JOIN emps
t2 ON (SELECT t2.empid)<=100}}, no longer fails on main: it returns all four
rows of {{emps}}. CALCITE-5638 (commit 00e09ac15e, fix version 1.40.0) fixed
it, and the query fails on the parent of that commit with the same
{{AssertionError}}. CALCITE-5638 also added a test with a correlated scalar
sub-query in a join's {{ON}} clause to {{sub-query.iq}}. I propose to resolve
this issue as Fixed in 1.40.0 and close PR
https://github.com/apache/calcite/pull/2571.
> Complex nested correlated subquery failed.
> ------------------------------------------
>
> Key: CALCITE-4833
> URL: https://issues.apache.org/jira/browse/CALCITE-4833
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.27.0
> Reporter: Evgeny Stanilovsky
> Priority: Major
> Labels: pull-request-available
> Attachments: test.patch
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Query like:
> {noformat}
> SELECT t1.empid FROM emps t1 LEFT JOIN emps t2 ON (SELECT t2.empid)<=100
> {noformat}
> failed with :
> {noformat}
> Required columns {5} not subset of left columns {0}
> java.lang.AssertionError: Required columns {5} not subset of left columns {0}
> at org.apache.calcite.util.Litmus$1.fail(Litmus.java:32)
> at org.apache.calcite.util.Litmus$1.check(Litmus.java:44)
> at org.apache.calcite.rel.core.Correlate.isValid(Correlate.java:127)
> at org.apache.calcite.rel.core.Correlate.<init>(Correlate.java:104)
> at
> org.apache.calcite.rel.logical.LogicalCorrelate.<init>(LogicalCorrelate.java:66)
> at
> org.apache.calcite.rel.logical.LogicalCorrelate.create(LogicalCorrelate.java:94)
> {noformat}
> failed test attached.
> The equal request works fine:
> {noformat}
> SELECT t1.empid FROM emps t1 LEFT JOIN emps t2 ON t2.empid<=100
> {noformat}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)