From a29d9797fdb176decf582929b8f1b80363558510 Mon Sep 17 00:00:00 2001 From: Mosha Pasumansky Date: Wed, 27 May 2026 17:23:03 -0700 Subject: [PATCH 1/3] Spark: enable SQL pipe operator (`|>`) Spark 4.0 added pipe-syntax SQL, sharing the operator set with the BigQuery / Pipe-SQL paper implementations already supported by `BigQueryDialect` and `GenericDialect`. Flip the `Dialect::supports_pipe_operator` flag on `SparkSqlDialect` so the existing pipe-operator parser path applies to Spark too. The 19 `parse_pipe_operator_*` tests and the `parse_pipeline_operator_negative_tests` test in `tests/sqlparser_common.rs` gate on `all_dialects_where(|d| d.supports_pipe_operator())`, so they pick up Spark automatically (all 20 pass). In addition, a Spark-specific `test_pipe_operator` test is added to `tests/sqlparser_spark.rs` to explicitly document the capability and guard against regressions if the shared gating changes. Refs: - Spark pipe-syntax docs: https://spark.apache.org/docs/latest/sql-pipe-syntax.html - Spark 4.0 release notes: https://spark.apache.org/releases/spark-release-4-0-0.html --- src/dialect/spark.rs | 11 +++++++++++ tests/sqlparser_spark.rs | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/src/dialect/spark.rs b/src/dialect/spark.rs index e14b4d033b..19e24e718d 100644 --- a/src/dialect/spark.rs +++ b/src/dialect/spark.rs @@ -116,6 +116,17 @@ impl Dialect for SparkSqlDialect { true } + /// Spark 4.0 added SQL pipe syntax (`|>`), sharing the operator set with + /// the Google BigQuery / Pipe-SQL paper implementations already + /// supported by [`BigQueryDialect`](crate::dialect::BigQueryDialect). + /// + /// See: + /// - + /// - + fn supports_pipe_operator(&self) -> bool { + true + } + /// Parse the `DIV` keyword as integer division. /// /// Example: `SELECT 10 DIV 3` returns `3`. diff --git a/tests/sqlparser_spark.rs b/tests/sqlparser_spark.rs index 3e1886c1da..7f2052919f 100644 --- a/tests/sqlparser_spark.rs +++ b/tests/sqlparser_spark.rs @@ -327,3 +327,12 @@ fn test_substring() { "SELECT SUBSTRING(s, 1, 3) FROM t", ); } + +// -------------------------------- +// Pipe operator (`|>`) +// -------------------------------- + +#[test] +fn test_pipe_operator() { + spark().verified_stmt("SELECT * FROM t |> WHERE x > 1 |> SELECT x AS y |> ORDER BY y"); +} From a9695fd56294884479f6608cca131d9eb72c3f8c Mon Sep 17 00:00:00 2001 From: Mosha Pasumansky <93998884+moshap-firebolt@users.noreply.github.com> Date: Fri, 29 May 2026 06:41:08 -0700 Subject: [PATCH 2/3] Update tests/sqlparser_spark.rs Co-authored-by: Ifeanyi Ubah --- tests/sqlparser_spark.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/sqlparser_spark.rs b/tests/sqlparser_spark.rs index 7f2052919f..3ec46c1077 100644 --- a/tests/sqlparser_spark.rs +++ b/tests/sqlparser_spark.rs @@ -328,10 +328,6 @@ fn test_substring() { ); } -// -------------------------------- -// Pipe operator (`|>`) -// -------------------------------- - #[test] fn test_pipe_operator() { spark().verified_stmt("SELECT * FROM t |> WHERE x > 1 |> SELECT x AS y |> ORDER BY y"); From 7ef00412fd73b0670c661a6ea5afa7f9fd971fe1 Mon Sep 17 00:00:00 2001 From: Mosha Pasumansky <93998884+moshap-firebolt@users.noreply.github.com> Date: Fri, 29 May 2026 06:41:21 -0700 Subject: [PATCH 3/3] Update src/dialect/spark.rs Co-authored-by: Ifeanyi Ubah --- src/dialect/spark.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/dialect/spark.rs b/src/dialect/spark.rs index 19e24e718d..534d18015c 100644 --- a/src/dialect/spark.rs +++ b/src/dialect/spark.rs @@ -116,10 +116,6 @@ impl Dialect for SparkSqlDialect { true } - /// Spark 4.0 added SQL pipe syntax (`|>`), sharing the operator set with - /// the Google BigQuery / Pipe-SQL paper implementations already - /// supported by [`BigQueryDialect`](crate::dialect::BigQueryDialect). - /// /// See: /// - /// -