[
https://issues.apache.org/jira/browse/CALCITE-7305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7305.
----------------------------------
Fix Version/s: 1.42.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/8f2d350670420ae4f5b0dc46b826cbf4f8e671eb]
Thank you for the review [~dmsysolyatin]
> Subqueries in ASOF JOIN MATCH_CONDITION cause an assertion failure
> ------------------------------------------------------------------
>
> Key: CALCITE-7305
> URL: https://issues.apache.org/jira/browse/CALCITE-7305
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.41.0
> Reporter: Mihai Budiu
> Assignee: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> The following test fails with an assertion failure:
> {code:java}
> WITH T1(id, intt) as (VALUES(1, 0)),
> T2(id, intt) AS (VALUES(1, 0)),
> T3(id) AS (VALUES(1))
> SELECT t1.id, t2.intt
> FROM T1 LEFT ASOF JOIN T2
> MATCH_CONDITION (t2.intt IN (SELECT id FROM T3))
> ON t1.id = t2.id {code}
> exception:
> {code:java}
> java.lang.NullPointerException: no SELECT scope for SELECT `ID`
> FROM `T3`
> at java.base/java.util.Objects.requireNonNull(Objects.java:360)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.getScope(SqlValidatorImpl.java:1224)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.getSelectScope(SqlValidatorImpl.java:1238)
> at
> org.apache.calcite.sql.validate.DelegatingScope.getOperandScope(DelegatingScope.java:237)
> at
> org.apache.calcite.sql.validate.SqlScopedShuttle.visit(SqlScopedShuttle.java:52)
> at
> org.apache.calcite.sql.validate.SqlScopedShuttle.visit(SqlScopedShuttle.java:37)
> at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:175) {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)