[
https://issues.apache.org/jira/browse/CALCITE-7403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zhen Chen resolved CALCITE-7403.
--------------------------------
Fix Version/s: 1.42.0
Assignee: Zhen Chen
Resolution: Fixed
Fixed in
[{{96e318b}}|https://github.com/apache/calcite/commit/96e318b6fab2722677f6264fb0bb10f2ffb32163]
Thanks for review [~mbudiu] [~dongsl]
> Missing ENUMERABLE Convention for LogicalConditionalCorrelate
> -------------------------------------------------------------
>
> Key: CALCITE-7403
> URL: https://issues.apache.org/jira/browse/CALCITE-7403
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.41.0
> Reporter: Zhen Chen
> Assignee: Zhen Chen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> Using CoreQuidemTest2 to test the following SQL will result in an error.
>
> {code:java}
> # [CALCITE-6786] ANY/SOME operator yields multiple rows in correlated queries
> WITH tb as (select array(SELECT * FROM (VALUES (TRUE), (NULL)) as x(a)) as a)
> SELECT TRUE IN (SELECT b FROM UNNEST(a) AS x1(b)) AS test FROM tb;
> +------+
> | TEST |
> +------+
> | true |
> +------+
> (1 row)
> !ok {code}
> Error message:
> {code:java}
> > java.sql.SQLException: Error while executing SQL "WITH tb as (select
> > array(SELECT * FROM (VALUES (TRUE), (NULL)) as x(a)) as a)
> > SELECT TRUE IN (SELECT b FROM UNNEST(a) AS x1(b)) AS test FROM tb": There
> > are not enough rules to produce a node with desired properties:
> > convention=ENUMERABLE, sort=[].
> > Missing conversion is LogicalConditionalCorrelate[convention: NONE ->
> > ENUMERABLE]
> > There is 1 empty subset: rel#1188424:RelSubset#7.ENUMERABLE.[], the
> > relevant part of the original plan is as follows
> > 1188394:LogicalConditionalCorrelate(correlation=[$cor0],
> > joinType=[left_mark], requiredColumns=[{0}], condition=[$1])
> > 1188384:Collect(subset=[rel#1188385:RelSubset#2.NONE.[]], field=[x])
> > 1188244:LogicalValues(subset=[rel#1188383:RelSubset#1.NONE.[0]],
> > tuples=[[{ true }, { null }]])
> > 1188392:Uncollect(subset=[rel#1188393:RelSubset#6.NONE.[]])
> > 1188390:LogicalProject(subset=[rel#1188391:RelSubset#5.NONE.[]],
> > A=[$cor0.A])
> > 1188237:LogicalValues(subset=[rel#1188382:RelSubset#0.NONE.[0]],
> > tuples=[[{ 0 }]]) {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)