Spark / Databricks SQL Formatter
Open in the Spark dialect with a backtick-identifier aggregate query as a starting point for Spark-style SQL used in Databricks. Paste your statements, select keyword case and two- or four-space indentation, and copy the local output. The Spark dialect is not certification of every Databricks-specific extension or notebook command.
Preparing current SQL output…
- Output
- Keywords
- Indent
Formatting arranges SQL statements for the selected dialect. It does not execute queries, validate database objects or optimize performance. Stored procedures and client batch directives are outside this formatter’s scope. SQL stays in this browser. Your input and settings are remembered in local browser storage; Start over clears them.
Common questions
- Does it support every Databricks extension?
- No. This interface uses the Spark dialect of the formatter. Some Databricks-specific syntax may be outside that dialect; check the output and run it in your intended environment.
- Can I paste a notebook with %sql or Python cells?
- Paste the SQL statement text from the cell. Notebook magic commands, Python, Scala and other-language cells are not SQL statements for this formatter.
- Will it execute or optimize the query?
- No. It formats query text locally and preserves backtick identifiers. Query execution, schema checks and Spark planning remain tasks for the target environment.
Formats SQL statements for the selected dialect; it does not execute SQL, check database objects, optimize queries or validate a complete SQL grammar. Stored procedures and client batch directives are outside its scope. Minify preserves comments and quoted values and can retain meaningful newlines.