LukaZdravic commented on code in PR #58823:
URL: https://github.com/apache/spark/pull/58823#discussion_r4034829431


##########
sql/core/src/test/resources/sql-tests/inputs/join-asof-datatypes.sql:
##########
@@ -127,6 +127,25 @@ FROM VALUES (TIMESTAMP '2026-06-29 10:00:00') AS t(ts) 
ASOF JOIN
      VALUES (TIMESTAMP_NTZ '2026-06-29 09:00:00') AS r(ts_ntz)
   MATCH_CONDITION (t.ts >= r.ts_ntz);
 
+-- FVT-ASOF-4-016a: coercion DATE vs STRING (SPARK-59527), coerced like the >= 
operator
+SELECT t.d, r.s AS matched_s
+FROM VALUES (DATE '2026-06-29') AS t(d) ASOF JOIN
+     VALUES ('2026-06-28'), ('2026-06-29') AS r(s)
+  MATCH_CONDITION (t.d >= r.s);
+
+-- FVT-ASOF-4-016b: coercion TIMESTAMP vs STRING (SPARK-59527)
+SELECT t.ts, r.s AS matched_s
+FROM VALUES (TIMESTAMP '2026-06-29 10:00:00') AS t(ts) ASOF JOIN
+     VALUES ('2026-06-29 09:00:00'), ('2026-06-29 10:00:00') AS r(s)
+  MATCH_CONDITION (t.ts >= r.s);
+
+-- FVT-ASOF-4-016c: coercion INT vs STRING sorts the right buffer by value, 
not lexicographically.
+-- '9' sorts after '10'/'20' as text but 9 < 10 < 20 by value; the as-of match 
for 20 must be 20.
+SELECT t.k, r.s AS matched_s
+FROM VALUES (20) AS t(k) ASOF JOIN

Review Comment:
   Yes, thank you!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to