Spark: enable SQL pipe operator (|>)#2358
Merged
Merged
Conversation
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
iffyio
reviewed
May 29, 2026
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
iffyio
approved these changes
May 30, 2026
Contributor
iffyio
left a comment
There was a problem hiding this comment.
Thanks @moshap-firebolt !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spark 4.0 added pipe-syntax SQL (
|>), sharing the operator set already implemented for BigQuery andGenericDialect. This PR flips theDialect::supports_pipe_operatorflag onSparkSqlDialectso the existing pipe-operator parser path applies to Spark too — no new parser code.Before — Spark rejected pipe syntax:
After — parses and round-trips correctly under
SparkSqlDialect.Tests
parse_pipe_operator_*tests andparse_pipeline_operator_negative_testsintests/sqlparser_common.rsgate onall_dialects_where(|d| d.supports_pipe_operator()), so they now exercise Spark automatically (all 20 pass).test_pipe_operatortotests/sqlparser_spark.rsto document the capability and guard against regressions if the shared gating changes.cargo test --all-features,cargo fmt --all, andcargo clippy --all-targets --all-features -- -D warningsall pass locally.Refs