You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2026/10/17 01:08:00 UTC

[jira] [Resolved] (SPARK-60000) MATCH_CONDITION rejects a column hidden by a nested USING join. ON accepts it.

     [ https://issues.apache.org/jira/browse/SPARK-60000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan resolved SPARK-60000.
---------------------------------
    Fix Version/s: 4.4.0
       Resolution: Fixed

Issue resolved by pull request 59267
[https://github.com/apache/spark/pull/59267]

> MATCH_CONDITION rejects a column hidden by a nested USING join. ON accepts it.
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-60000
>                 URL: https://issues.apache.org/jira/browse/SPARK-60000
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 4.4.0
>            Reporter: Luka Zdravic
>            Assignee: Luka Zdravic
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.4.0
>
>
> {code:sql}
>   
>   -- fails: [ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE] ... Got: "lts" and "k".
>   SELECT l.lts, r.rts
>   FROM (VALUES (1, 10), (2, 20)) AS l(k, lts)
>   ASOF JOIN ((VALUES (1, 5), (2, 15)) AS r(k, rts) JOIN (VALUES (1), (2)) AS d(k) USING (k))
>     MATCH_CONDITION (l.lts >= d.k);
>     
>   -- works:
>   SELECT l.lts, r.rts
>   FROM (VALUES (1, 10), (2, 20)) AS l(k, lts)
>   JOIN ((VALUES (1, 5), (2, 15)) AS r(k, rts) JOIN (VALUES (1), (2)) AS d(k) USING (k))
>     ON l.lts >= d.k;
>   {code}
> Cause: the side check looks only at visible columns (left.outputSet / right.outputSet in ResolveAsOfJoin), so d.k has no side.
> Expected: the ASOF query returns (10, 15) and (20, 15).
> Assigned to : [~lukazdravic] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org