vranes commented on code in PR #58657:
URL: https://github.com/apache/spark/pull/58657#discussion_r4017547881


##########
sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSQLSuite.scala:
##########
@@ -242,6 +260,27 @@ class AsOfJoinSQLSuite extends QueryTest with 
SharedSparkSession {
     assert(asOfJoin.asOfCondition.resolved)
   }
 
+  test("MATCH_CONDITION with two literal operands passes analysis") {
+    setupTradeQuoteViews()
+    val sqlText =
+      """
+        |SELECT count(*)
+        |FROM trades t ASOF JOIN quotes q
+        |  MATCH_CONDITION (TIMESTAMP '2026-06-29 10:00:00' >= TIMESTAMP 
'2026-06-29 09:00:00')
+        |  ON t.symbol = q.symbol
+        |""".stripMargin
+    // Both operands are literals with no column refs, so each takes its 
syntactic side
+    // (expr1 = left, expr2 = right) and the MATCH_CONDITION materializes.
+    val asOfJoin = sql(sqlText).queryExecution.analyzed.collectFirst {
+      case j: AsOfJoin => j
+    }.get
+    // Populated sort keys prove the operands were assigned to opposite sides 
and the condition

Review Comment:
   Good catch,  dropped the two sort-key asserts, kept `asOfCondition.resolved`.



-- 
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