feat(dsql): parse ALTER COLUMN drop forms - #5
Merged
Conversation
This was referenced Aug 27, 2026
amaksimo
added a commit
to awslabs/aurora-dsql-tools
that referenced
this pull request
Aug 27, 2026
## Problem `dsql-lint` rejects several forms accepted by Aurora DSQL and misses explicit index-key directions that DSQL rejects: - expression indexes are reported as unsupported - `ALTER TABLE ... DROP CONSTRAINT` is rejected unconditionally - `ALTER COLUMN ... DROP IDENTITY` and `DROP EXPRESSION` fail to parse - index-key `ASC` and `DESC` lint clean but fail on DSQL ## Changes - upgrade to `sqlparser-dsql` 0.62.5 for typed `DROP IDENTITY [IF EXISTS]` and `DROP EXPRESSION [IF EXISTS]` parsing - remove the obsolete expression-index and blanket `DROP CONSTRAINT` rejection rules - add `IndexSortDirection` diagnostics and fixes: - remove explicit `ASC` as a mechanical fix - remove `DESC` with a warning - preserve supported `NULLS FIRST` / `NULLS LAST` - expand the shared unit/grammar/cluster matrices for every affected form Parser PR: amaksimo/datafusion-sqlparser-rs#5 Parser release: https://crates.io/crates/sqlparser-dsql/0.62.5 ## Live DSQL verification Accepted on a live cluster: - function and arithmetic expression indexes - index keys with `NULLS FIRST` and `NULLS LAST` - dropping named CHECK and UNIQUE constraints, including `IF EXISTS` - `DROP IDENTITY` and `DROP EXPRESSION`, with and without `IF EXISTS` Rejected on the same cluster: - index-key `ASC` and `DESC` - dropping a PRIMARY KEY constraint The last case is schema-dependent: a standalone `DROP CONSTRAINT name` statement does not identify the constraint type. The linter therefore accepts the supported syntax, while the cluster suite pins the primary-key runtime rejection explicitly. ## Validation - `cargo fmt -- --check` - `cargo test` - `cargo test --all-features` - `cargo clippy --all-targets --all-features -- -D warnings` - `cargo package --allow-dirty` - grammar corpus mirror regenerated and verified - live-cluster `clean_statements_accepted_by_cluster` - live-cluster `drop_primary_key_constraint_rejected_by_cluster` - live-cluster `lint_rule_fixtures_validated_on_cluster` A separate version-only PR will publish the release after this change merges. --- By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution under the terms of the project license.
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
ALTER COLUMN ... DROP IDENTITY [IF EXISTS]ALTER COLUMN ... DROP EXPRESSION [IF EXISTS]IF EXISTSflag in the typed AST and display outputsqlparser-dsqlto 0.62.5DSQL verification
Both forms, with and without
IF EXISTS, were executed successfully against a live Aurora DSQL cluster on August 26, 2026. Temporary test objects were removed and the catalog was checked for leftovers.Validation
cargo fmt --all -- --checkcargo test --all-featurescargo clippy --all-targets --all-features -- -D warningscargo package --allow-dirtyBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution under the terms of the project license.