Luka Zdravic created SPARK-59529:
------------------------------------

             Summary: ASOF JOIN MATCH_CONDITION accepts a constant operand 
referencing no join input
                 Key: SPARK-59529
                 URL: https://issues.apache.org/jira/browse/SPARK-59529
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: Luka Zdravic


MATCH_CONDITION accepts an operand that references no join input, such as a 
literal or current_date(). Spark assigns the constant to its syntactic side and 
builds the join. The as-of match compares one left column to one right column 
to find the nearest row, so an operand that references neither input has no 
well-defined meaning.

SELECT * FROM t ASOF JOIN u
MATCH_CONDITION (t.ts >= current_date());   -- accepted today
Expected: reject a MATCH_CONDITION operand that does not reference exactly one 
join input.
Impact: a query that reads like an as-of join runs with no defined 
nearest-match.

 

Umbrella: SPARK-59526



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to