Repository navigation
feat: format Databricks with SQLQuack - #57
Merged
Merged
Conversation
Databricks files are laid out by SQLQuack's Databricks profile, which
reads them with the Databricks scanner and parser. Of the 62 Databricks
corpus queries, 60 come out as SQLClean laid them out before. A ${x}
variable substitution, which the Databricks parser rejects, is left as
written with a warning, and get_json_object is upper-cased as every
other call is.
Deploying sqlclean with
|
| Latest commit: |
98a19b8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://89a4b13f.sqlclean.pages.dev |
| Branch Preview URL: | https://feat-databricks-format.sqlclean.pages.dev |
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.
Why
SQLQuack now has a native Databricks formatter profile, and SQLClean already pins a SQLQuack commit that includes it (f53c6a07). Until now SQLClean reported Databricks formatting as unavailable and left every Databricks query as written.
Changes
sqlquack-formatgains thedatabricksfeature. Cargo.lock does not change.databricksdialect to SQLQuack's Databricks profile.sqlquack_departures.json:SELECT ${x} FROM ${y} …is refused and left as written with a warning.${x}is a substitution Databricks replaces before parsing, so the native parser rejects it.get_json_object(...)is upper-cased, as every other call is in every dialect.formatto lay out a Databricks file.Verification
cargo test --all --locked,cargo clippy --all-targets -- -D warnings,cargo fmt --check,make check-docs-skillanduv run pytest tests(72 passed, native package rebuilt from this branch) all pass.format databrickslines differ (124 lines: 122 now formatted, 2 the${x}refusal). Every other dialect is byte-identical.