[
https://issues.apache.org/jira/browse/CALCITE-7933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143286#comment-18143286
]
Mihai Budiu commented on CALCITE-7933:
--------------------------------------
I will submit a PR which will fix this issue. The PR will also have the
validator reject some other usages of lambdas which currently crash the
compiler; we can fix these cases later if desired. An example that will be
rejected is calling an aggregate function in the body of a lambda.
> Correlated subqueries with lambdas that capture columns are incorrectly
> compiled
> --------------------------------------------------------------------------------
>
> Key: CALCITE-7933
> URL: https://issues.apache.org/jira/browse/CALCITE-7933
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.42.0
> Reporter: Mihai Budiu
> Assignee: Mihai Budiu
> Priority: Minor
>
> The following SQL program causes a crash:
> {code:sql}
> select t.x,
> (select count(*) from (values (array[1, 5], 5), (array[1], 6)) as s(b, y)
> where "EXISTS"(s.b, e -> e = t.x)) as c
> from (values (1), (7)) as t(x);
> {code}
> {noformat}
> java.lang.AssertionError: type mismatch:
> ref:
> INTEGER NOT NULL
> input:
> INTEGER NOT NULL ARRAY NOT NULL
> at org.apache.calcite.rex.RexChecker.visitInputRef(RexChecker.java:131)
> ...
> at org.apache.calcite.rel.core.Filter.isValid(Filter.java:165)
> ...
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1376)
> {noformat}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)