Repository navigation
fix: read SQL with SQLBabel 0.39.0 and keep held Databricks forms as written - #109
Merged
Merged
Conversation
Not ready: pinned to sqlbabel main (b1fe6f3c), not the v0.39.0 tag; the lint corpus changes on 24 Databricks queries and is not accepted. Checked locally: every other Rust test passes.
SQLBabel reads six Databricks forms as trees but holds them from layout until it reviews them: alter_column, alter_connection, create_function, create_sql_function, insert_overwrite_directory_hive and query_tags. Lint now reads these statements from their tree, so they give the same findings as before instead of a parse error, but those findings carry no fix. fix and format leave each such statement byte for byte as written, and check, format, JSON and SARIF output give one note per statement. The note never fails a command. Release note: no fixes on the six held Databricks forms until SQLBabel reviews their layout.
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
SQLClean reads SQL with SQLQuack's parsers, which are now released as SQLBabel. SQLBabel 0.39.0 reads six Databricks forms as trees but holds them from layout until it reviews them:
alter_column,alter_connection,create_function,create_sql_function,insert_overwrite_directory_hiveandquery_tags. Read through the reviewed parser, those statements would become parse errors, and fixing or formatting them could rewrite layout SQLBabel has not checked.Changes
fixandformatleave each held statement byte for byte as written and still fix and format the rest of the file.checkgives one note per held statement in text, JSON (held,summary.held) and SARIF (anotenotification);formatprints it on stderr. A note never changes the exit code.''escape) and 3 DEFERRABLE constraints now parse; the 14 held queries match 0.12.2.Release note: no fixes on the six held Databricks forms until SQLBabel reviews their layout.
Verification
cargo test --workspace,cargo clippy --all-targets -- -D warnings,cargo fmt --check,fensu check, ruff, ty and the docs-skill check pass.check,formatandfix --unsafe-fixesbyte identity. The Python suite passes (99 tests).