Repository navigation
[BUG] Preserve DML predicates when comments mention DDL clauses - #62
Merged
Merged
Conversation
Collaborator
Author
|
Ready to merge. Reviewed the full PR at commit 92e67c2; no remaining high or critical defects were confirmed within the requested review scope. All 56 targeted Docker tests pass, including the regression that verifies an unsupported external-table replacement preserves existing data. GitHub CI lint, test, and UI checks are green. |
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.
Summary
A comment containing
) USING DELTAcould make the SQL rewrite remove a DELETE or UPDATE predicate. The rewrite now recognizes actualUSING <format>clauses after a CREATE TABLE column list, while ignoring comments, quoted text, CTAS queries, and subsequent statements in a SQL script. Continued escape strings remain opaque to statement splitting and DDL matching. CommentedUSING DELTA LOCATIONdeclarations are classified as external tables before the compatibility rewrite can remove their storage location, including comments beside catalog/schema qualification dots. If an external declaration uses a form the classifier cannot register, the rewrite keepsLOCATIONin place so execution fails safely without replacing existing data.Closes #58
Validation
USING SAMPLE, continued E-string content, external Delta registration with comments beforeUSINGand beside a qualification dot, and preservation of an existing table whenCREATE OR REPLACE ... LOCATIONis unsupported.pytest tests/test_sql_statements.py tests/unity_catalog/test_delta_tables.py -q— 56 passed.ruff check src/minilake/services/sql_statements.py tests/test_sql_statements.py tests/unity_catalog/test_delta_tables.pyruff format --check src/minilake/services/sql_statements.py tests/test_sql_statements.py tests/unity_catalog/test_delta_tables.pygit diff --check