This is an automated email from the ASF dual-hosted git repository.
uros-b pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f9358a5587a2 [SPARK-59529][SQL][FOLLOWUP] Restore refs1/refs2
parameter names for ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE
f9358a5587a2 is described below
commit f9358a5587a2d512c5cf08ba4b10d60007c93f6e
Author: Luka Zdravić <[email protected]>
AuthorDate: Tue Sep 29 13:23:59 2026 +0000
[SPARK-59529][SQL][FOLLOWUP] Restore refs1/refs2 parameter names for
ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE
### What changes were proposed in this pull request?
This follow-up to #58853 renames the message parameters of
`ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE` back from `operand1`/`operand2` to
`refs1`/`refs2`. The new message text from #58853 stays, so the rendered
message does not change.
```
Before: "messageParameters" : { "operand1" : "\"trade_time\"", "operand2" :
"\"TIMESTAMP '2026-06-29 10:00:00'\"" }
After: "messageParameters" : { "refs1" : "\"trade_time\"", "refs2" :
"\"TIMESTAMP '2026-06-29 10:00:00'\"" }
```
### Why are the changes needed?
Spark 4.3 already ships this error with `refs1`/`refs2` (see branch-4.3 and
v4.3.0-rc1). The rename in #58853 was an optional cleanup, and it would change
the parameter names between 4.3 and 4.4.
### Does this PR introduce _any_ user-facing change?
No. #58853 is not in any release. This keeps the parameter names the same
as in Spark 4.3. The error class, SQLSTATE, and rendered message do not change.
### How was this patch tested?
Updated `AsOfJoinSQLSuite` to the old names and regenerated
`join-asof-errors.sql.out` (results and analyzer-results).
`SQLQueryTestSuite`, `AsOfJoinSQLSuite`, and `ResolveAsOfJoinSuite` pass
locally.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code
Closes #59099 from LukaZdravic/SPARK-59529-followup-refs.
Authored-by: Luka Zdravić <[email protected]>
Signed-off-by: Uros Bojanic <[email protected]>
---
.../src/main/resources/error/error-conditions.json | 2 +-
.../sql/catalyst/analysis/ResolveAsOfJoin.scala | 4 ++--
.../spark/sql/errors/QueryCompilationErrors.scala | 4 ++--
.../analyzer-results/join-asof-errors.sql.out | 28 +++++++++++-----------
.../sql-tests/results/join-asof-errors.sql.out | 28 +++++++++++-----------
.../org/apache/spark/sql/AsOfJoinSQLSuite.scala | 26 ++++++++++----------
6 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/common/utils/src/main/resources/error/error-conditions.json
b/common/utils/src/main/resources/error/error-conditions.json
index 935ab587cb37..500f3cf9e760 100644
--- a/common/utils/src/main/resources/error/error-conditions.json
+++ b/common/utils/src/main/resources/error/error-conditions.json
@@ -176,7 +176,7 @@
},
"ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE" : {
"message" : [
- "Each operand of the MATCH_CONDITION comparison must reference exactly
one join input, and the two operands must reference different inputs. Got:
<operand1> and <operand2>."
+ "Each operand of the MATCH_CONDITION comparison must reference exactly
one join input, and the two operands must reference different inputs. Got:
<refs1> and <refs2>."
],
"sqlState" : "42K0E"
},
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveAsOfJoin.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveAsOfJoin.scala
index 33ca926fc060..f5f828fc6ed6 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveAsOfJoin.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveAsOfJoin.scala
@@ -188,8 +188,8 @@ private[analysis] object AsOfJoinValidation extends
QueryErrorsBase {
join.failAnalysis(
errorClass = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
messageParameters = Map(
- "operand1" -> toSQLExpr(leftExpr),
- "operand2" -> toSQLExpr(rightExpr)))
+ "refs1" -> toSQLExpr(leftExpr),
+ "refs2" -> toSQLExpr(rightExpr)))
}
}
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
index 46a950988d0d..6ad8b7a6acbe 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
@@ -5163,8 +5163,8 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase with Compilat
new AnalysisException(
errorClass = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
messageParameters = Map(
- "operand1" -> toSQLExpr(expr1),
- "operand2" -> toSQLExpr(expr2)))
+ "refs1" -> toSQLExpr(expr1),
+ "refs2" -> toSQLExpr(expr2)))
}
def nestedSequentialStreamingUnionError(): Throwable = {
diff --git
a/sql/core/src/test/resources/sql-tests/analyzer-results/join-asof-errors.sql.out
b/sql/core/src/test/resources/sql-tests/analyzer-results/join-asof-errors.sql.out
index 1d8740ac87f8..8f3a0216148f 100644
---
a/sql/core/src/test/resources/sql-tests/analyzer-results/join-asof-errors.sql.out
+++
b/sql/core/src/test/resources/sql-tests/analyzer-results/join-asof-errors.sql.out
@@ -439,8 +439,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"(trade_time + (quote_time - trade_time))\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"(trade_time + (quote_time - trade_time))\"",
+ "refs2" : "\"quote_time\""
},
"queryContext" : [ {
"objectType" : "",
@@ -462,8 +462,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"trade_time\"",
- "operand2" : "\"trade_time - INTERVAL '01' HOUR\""
+ "refs1" : "\"trade_time\"",
+ "refs2" : "\"trade_time - INTERVAL '01' HOUR\""
}
}
@@ -602,8 +602,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"quote_time\"",
- "operand2" : "\"quote_time - INTERVAL '01' HOUR\""
+ "refs1" : "\"quote_time\"",
+ "refs2" : "\"quote_time - INTERVAL '01' HOUR\""
}
}
@@ -618,8 +618,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"trade_time\"",
- "operand2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
+ "refs1" : "\"trade_time\"",
+ "refs2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
}
}
@@ -634,8 +634,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"TIMESTAMP '2026-06-29 10:00:00'\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"TIMESTAMP '2026-06-29 10:00:00'\"",
+ "refs2" : "\"quote_time\""
}
}
@@ -650,8 +650,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"current_timestamp()\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"current_timestamp()\"",
+ "refs2" : "\"quote_time\""
}
}
@@ -666,7 +666,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"TIMESTAMP '2026-06-29 10:00:01'\"",
- "operand2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
+ "refs1" : "\"TIMESTAMP '2026-06-29 10:00:01'\"",
+ "refs2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
}
}
diff --git
a/sql/core/src/test/resources/sql-tests/results/join-asof-errors.sql.out
b/sql/core/src/test/resources/sql-tests/results/join-asof-errors.sql.out
index eeb77c87ef04..b4188d01aa14 100644
--- a/sql/core/src/test/resources/sql-tests/results/join-asof-errors.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/join-asof-errors.sql.out
@@ -473,8 +473,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"(trade_time + (quote_time - trade_time))\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"(trade_time + (quote_time - trade_time))\"",
+ "refs2" : "\"quote_time\""
},
"queryContext" : [ {
"objectType" : "",
@@ -498,8 +498,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"trade_time\"",
- "operand2" : "\"trade_time - INTERVAL '01' HOUR\""
+ "refs1" : "\"trade_time\"",
+ "refs2" : "\"trade_time - INTERVAL '01' HOUR\""
}
}
@@ -652,8 +652,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"quote_time\"",
- "operand2" : "\"quote_time - INTERVAL '01' HOUR\""
+ "refs1" : "\"quote_time\"",
+ "refs2" : "\"quote_time - INTERVAL '01' HOUR\""
}
}
@@ -670,8 +670,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"trade_time\"",
- "operand2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
+ "refs1" : "\"trade_time\"",
+ "refs2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
}
}
@@ -688,8 +688,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"TIMESTAMP '2026-06-29 10:00:00'\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"TIMESTAMP '2026-06-29 10:00:00'\"",
+ "refs2" : "\"quote_time\""
}
}
@@ -706,8 +706,8 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"current_timestamp()\"",
- "operand2" : "\"quote_time\""
+ "refs1" : "\"current_timestamp()\"",
+ "refs2" : "\"quote_time\""
}
}
@@ -724,7 +724,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
"sqlState" : "42K0E",
"messageParameters" : {
- "operand1" : "\"TIMESTAMP '2026-06-29 10:00:01'\"",
- "operand2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
+ "refs1" : "\"TIMESTAMP '2026-06-29 10:00:01'\"",
+ "refs2" : "\"TIMESTAMP '2026-06-29 10:00:00'\""
}
}
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSQLSuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSQLSuite.scala
index f0fbfc375f25..edbc6d866747 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSQLSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSQLSuite.scala
@@ -134,8 +134,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"(trade_time + quote_time)\"",
- "operand2" -> "\"quote_time\""),
+ "refs1" -> "\"(trade_time + quote_time)\"",
+ "refs2" -> "\"quote_time\""),
queryContext = Array(
ExpectedContext(
fragment = """ASOF JOIN quotes q
@@ -159,8 +159,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"symbol\"",
- "operand2" -> "\"symbol\""))
+ "refs1" -> "\"symbol\"",
+ "refs2" -> "\"symbol\""))
}
test("MATCH_CONDITION rejects a literal even when a same-side column is
present") {
@@ -177,7 +177,7 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
exception = intercept[AnalysisException](sql(sqlText)),
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
- parameters = Map("operand1" -> "\"symbol\"", "operand2" -> "\"AAPL\""))
+ parameters = Map("refs1" -> "\"symbol\"", "refs2" -> "\"AAPL\""))
}
test("MATCH_CONDITION rejects non-deterministic expressions") {
@@ -290,8 +290,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"current_timestamp()\"",
- "operand2" -> "\"quote_time\""))
+ "refs1" -> "\"current_timestamp()\"",
+ "refs2" -> "\"quote_time\""))
}
test("MATCH_CONDITION rejects a literal constant operand (no join input
reference)") {
@@ -308,8 +308,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"trade_time\"",
- "operand2" -> "\"TIMESTAMP '2026-06-29 10:00:00'\""))
+ "refs1" -> "\"trade_time\"",
+ "refs2" -> "\"TIMESTAMP '2026-06-29 10:00:00'\""))
}
test("MATCH_CONDITION rejects two literal operands (neither references a
join input)") {
@@ -327,8 +327,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"TIMESTAMP '2026-06-29 10:00:00'\"",
- "operand2" -> "\"TIMESTAMP '2026-06-29 09:00:00'\""))
+ "refs1" -> "\"TIMESTAMP '2026-06-29 10:00:00'\"",
+ "refs2" -> "\"TIMESTAMP '2026-06-29 09:00:00'\""))
}
test("MATCH_CONDITION rejects a constant operand under the single-pass
analyzer") {
@@ -346,8 +346,8 @@ class AsOfJoinSQLSuite extends QueryTest with
SharedSparkSession {
condition = "ASOF_JOIN_MATCH_CONDITION_TABLE_REFERENCE",
sqlState = Some("42K0E"),
parameters = Map(
- "operand1" -> "\"trade_time\"",
- "operand2" -> "\"TIMESTAMP '2026-06-29 10:00:00'\""))
+ "refs1" -> "\"trade_time\"",
+ "refs2" -> "\"TIMESTAMP '2026-06-29 10:00:00'\""))
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]