Skip to content

Snowflake: Add support for ->> (pipe) operator for chaining SQL stmts - #2438

Open
BenSatori wants to merge 1 commit into
apache:mainfrom
BenSatori:snowflake-pipe-operator
Open

Snowflake: Add support for ->> (pipe) operator for chaining SQL stmts#2438
BenSatori wants to merge 1 commit into
apache:mainfrom
BenSatori:snowflake-pipe-operator

Conversation

@BenSatori

Copy link
Copy Markdown

The ->> (flow/pipe) operator chains multiple SQL statements in Snowflake.

Before: Parser rejected pipe chains like SELECT * FROM t1 ->> SELECT * FROM $1

After: Parser correctly handles:

  • Chained statements with ->> operator
  • Pipe result references ($1, $2, $3, etc.)
  • Round-trip SQL serialization

Example:

SELECT * FROM users WHERE active = true ->> SELECT COUNT(*) FROM $1

Changes:

  • Added Statement::Pipe AST variant for chained statements
  • Added TableFactor::PipeResultScan for $n result references
  • Extended Snowflake dialect with pipe operator support
  • Comprehensive test coverage (2 test functions, multiple edge cases)

Snowflake docs:
https://docs.snowflake.com/en/sql-reference/operators-flow#pipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant