From d0816cb1b0a3ce5cf829a53f335044ee97c38b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Zdravi=C4=87?= Date: Tue, 8 Sep 2026 15:24:16 +0000 Subject: [PATCH 1/2] [SPARK-59299][SQL][TESTS][FOLLOWUP] Split ASOF JOIN parser test cases into separate tests The `test("asof join")` block in PlanParserSuite bundled nine positive parsing cases under a single test name. On a failure the report would only name `asof join`, not which case broke, and because the first failing assertion aborts the block, the later cases would not run. Split the block so each scenario is its own named test: - basic MATCH_CONDITION (kept as `asof join`); - LEFT ASOF with an ON condition; - USING single / multiple join columns; - the `<=`, `>` and `<` match operators; - explicit INNER / LEFT OUTER join types. No assertions were changed; this only redistributes the existing cases into named tests. Follow-up to the review on SPARK-59299 (apache/spark#58578). Test-only; no production code changes. --- .../sql/catalyst/parser/PlanParserSuite.scala | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala index e8e2a96d2b4b..d9fbb2d4be95 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala @@ -1056,7 +1056,11 @@ class PlanParserSuite extends AnalysisTest { $"u.a", None, Inner).select(star())) + } + } + test("asof join - left asof with on condition") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t left asof join u match_condition (t.a >= u.a) on t.b = u.b", AsOfJoin.fromMatchCondition( @@ -1067,7 +1071,11 @@ class PlanParserSuite extends AnalysisTest { $"u.a", Some($"t.b" === $"u.b"), LeftOuter).select(star())) + } + } + test("asof join - using single join column") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a >= u.a) using (b)", AsOfJoin.fromMatchCondition( @@ -1079,7 +1087,11 @@ class PlanParserSuite extends AnalysisTest { None, Inner, usingColumns = Some(Seq("b"))).select(star())) + } + } + test("asof join - using multiple join columns") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a >= u.a) using (a, b)", AsOfJoin.fromMatchCondition( @@ -1091,7 +1103,11 @@ class PlanParserSuite extends AnalysisTest { None, Inner, usingColumns = Some(Seq("a", "b"))).select(star())) + } + } + test("asof join - less than or equal match operator") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (u.a <= t.a)", AsOfJoin.fromMatchCondition( @@ -1102,7 +1118,11 @@ class PlanParserSuite extends AnalysisTest { $"t.a", None, Inner).select(star())) + } + } + test("asof join - greater than match operator") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a > u.a)", AsOfJoin.fromMatchCondition( @@ -1113,7 +1133,11 @@ class PlanParserSuite extends AnalysisTest { $"u.a", None, Inner).select(star())) + } + } + test("asof join - less than match operator") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a < u.a)", AsOfJoin.fromMatchCondition( @@ -1124,7 +1148,11 @@ class PlanParserSuite extends AnalysisTest { $"u.a", None, Inner).select(star())) + } + } + test("asof join - explicit inner join type") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t inner asof join u match_condition (t.a >= u.a)", AsOfJoin.fromMatchCondition( @@ -1135,7 +1163,11 @@ class PlanParserSuite extends AnalysisTest { $"u.a", None, Inner).select(star())) + } + } + test("asof join - explicit left outer join type") { + withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t left outer asof join u match_condition (t.a >= u.a)", AsOfJoin.fromMatchCondition( From dc4ea22756ca734cca5dc8af6b018333154c5869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Zdravi=C4=87?= Date: Tue, 8 Sep 2026 16:30:37 +0000 Subject: [PATCH 2/2] [SPARK-59299][SQL][TESTS][FOLLOWUP] Rename split ASOF JOIN tests per review Address review nits on the split tests: - `left asof with on condition` -> `explicit left join type with on condition`, to match the explicit inner / left outer join type tests below; - `using single join column` / `using multiple join columns` -> `using with a single join column` / `using with multiple join columns`. Test-only; test names only, no assertion changes. --- .../apache/spark/sql/catalyst/parser/PlanParserSuite.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala index d9fbb2d4be95..4f1512f1f20a 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala @@ -1059,7 +1059,7 @@ class PlanParserSuite extends AnalysisTest { } } - test("asof join - left asof with on condition") { + test("asof join - explicit left join type with on condition") { withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t left asof join u match_condition (t.a >= u.a) on t.b = u.b", @@ -1074,7 +1074,7 @@ class PlanParserSuite extends AnalysisTest { } } - test("asof join - using single join column") { + test("asof join - using with a single join column") { withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a >= u.a) using (b)", @@ -1090,7 +1090,7 @@ class PlanParserSuite extends AnalysisTest { } } - test("asof join - using multiple join columns") { + test("asof join - using with multiple join columns") { withSQLConf(SQLConf.SQL_ASOF_JOIN_ENABLED.key -> "true") { assertEqual( "select * from t asof join u match_condition (t.a >= u.a) using (a, b)",