You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support Pipe Syntax Formatting on DBx and BigQuery #885
Describe the Feature
Support formatting pipe syntax for Dabaricks and BigQuery.
In this syntax, SQL queries are expressed in a functional style using the pipe operator (|>), allowing operations like SELECT, WHERE, and GROUP BY to be chained together in a readable and modular way. Pipe syntax improves the clarity and structure of SQL by allowing queries to be written as a sequence of transformations, where each step builds on the previous one. This functional style enhances readability, especially for complex queries, by breaking them into logically organized components. It also promotes modular and maintainable code, making it easier to reason about and modify individual parts of a query. As a result, pipe syntax is becoming increasingly popular in modern data workflows and tools that emphasize composability and developer ergonomics.
Why do you want this feature?
Pipe syntax is increasingly being adopted for its readability and composability, especially in data platforms like BigQuery and Databricks. However, most SQL formatters, including this one, do not currently support it. Adding support for pipe syntax would help teams using modern SQL styles to maintain clean, readable, and consistently formatted code without needing to fall back to manual formatting or workarounds. This would be especially valuable in environments that prioritize functional or declarative query composition.
Thanks for the feature request. So basically this comes down to being able to write the following SQL:
SELECT item, COUNT(*) AS num_items, SUM(sales) AS total_sales
FROM Produce
WHERE
item !='bananas'AND category IN ('fruit', 'nut')
GROUP BY item
ORDER BY item DESC;
as:
FROM Produce
|>WHERE
item !='bananas'AND category IN ('fruit', 'nut')
|> AGGREGATE COUNT(*) AS num_items, SUM(sales) AS total_sales
GROUP BY item
|>ORDER BY item DESC;
It's definitely a major thing to consider. Though it's also a major departure from standard SQL syntax and a major feature to implement.
There's more of a chance that I'll implement support for it in sql-parser-cst and the related prettier plugin. But implementing it in SQL formatter is less likely.
Activity
nene commentedon Aug 15, 2025
Thanks for the feature request. So basically this comes down to being able to write the following SQL:
as:
It's definitely a major thing to consider. Though it's also a major departure from standard SQL syntax and a major feature to implement.
There's more of a chance that I'll implement support for it in sql-parser-cst and the related prettier plugin. But implementing it in SQL formatter is less likely.