Luka Zdravic created SPARK-59527:
------------------------------------

             Summary: ASOF JOIN MATCH_CONDITION rejects DATE vs STRING accepted 
by the comparison operator
                 Key: SPARK-59527
                 URL: https://issues.apache.org/jira/browse/SPARK-59527
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: Luka Zdravic


Inside a MATCH_CONDITION, comparing a DATE column to a STRING column fails with 
ASOF_JOIN_MATCH_CONDITION_INVALID_TYPE. The same comparison outside ASOF works:

Spark coerces the string to date. ASOF should apply the same coercion.
-- fails:
SELECT * FROM (VALUES (DATE'2024-01-03')) l(d)
ASOF JOIN (VALUES ('2024-01-01')) r(s)
MATCH_CONDITION (l.d >= r.s);        -- ASOF_JOIN_MATCH_CONDITION_INVALID_TYPE
-- works:
SELECT DATE'2024-01-03' >= '2024-01-01';   -- true
Expected: MATCH_CONDITION accepts and coerces the pair, same as the comparison 
operator.
Reproduces under ANSI on and off.
Impact: a valid date-vs-string as-of condition that is a legal comparison 
cannot be written.

 

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