You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "moshap-firebolt (via GitHub)" <gi...@apache.org> on 2026/05/28 19:27:25 UTC

[PR] Spark: enable SQL pipe operator (`|>`) [datafusion-sqlparser-rs]

moshap-firebolt opened a new pull request, #2358:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2358

   Spark 4.0 added pipe-syntax SQL (`|>`), sharing the operator set already implemented for BigQuery and `GenericDialect`. This PR flips the `Dialect::supports_pipe_operator` flag on `SparkSqlDialect` so the existing pipe-operator parser path applies to Spark too — no new parser code.
   
   **Before** — Spark rejected pipe syntax:
   ```
   SELECT * FROM t |> WHERE x > 1 |> SELECT x AS y |> ORDER BY y
   -- ParserError
   ```
   
   **After** — parses and round-trips correctly under `SparkSqlDialect`.
   
   ### Tests
   - The 19 `parse_pipe_operator_*` tests and `parse_pipeline_operator_negative_tests` in `tests/sqlparser_common.rs` gate on `all_dialects_where(|d| d.supports_pipe_operator())`, so they now exercise Spark automatically (all 20 pass).
   - Adds a Spark-specific `test_pipe_operator` to `tests/sqlparser_spark.rs` to document the capability and guard against regressions if the shared gating changes.
   
   `cargo test --all-features`, `cargo fmt --all`, and `cargo clippy --all-targets --all-features -- -D warnings` all pass locally.
   
   ### 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
   - SPARK-49528 (umbrella JIRA): https://issues.apache.org/jira/browse/SPARK-49528
   - SPARK-50778 (parser feature): https://issues.apache.org/jira/browse/SPARK-50778


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Spark: enable SQL pipe operator (`|>`) [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2358:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2358#discussion_r3323070008


##########
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).
+    ///

Review Comment:
   ```suggestion
   ```



##########
tests/sqlparser_spark.rs:
##########
@@ -327,3 +327,12 @@ fn test_substring() {
         "SELECT SUBSTRING(s, 1, 3) FROM t",
     );
 }
+
+// --------------------------------
+// Pipe operator (`|>`)
+// --------------------------------

Review Comment:
   ```suggestion
   ```



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Spark: enable SQL pipe operator (`|>`) [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2358:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2358


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org