Skip to content

feat(dsql): parse ALTER COLUMN drop forms - #5

Merged
amaksimo merged 1 commit into
dsql-async-indexfrom
feat/dsql-drop-column-forms
Aug 26, 2026
Merged

feat(dsql): parse ALTER COLUMN drop forms#5
amaksimo merged 1 commit into
dsql-async-indexfrom
feat/dsql-drop-column-forms

Conversation

@amaksimo

Copy link
Copy Markdown
Owner

Summary

  • parse ALTER COLUMN ... DROP IDENTITY [IF EXISTS]
  • parse ALTER COLUMN ... DROP EXPRESSION [IF EXISTS]
  • preserve the optional IF EXISTS flag in the typed AST and display output
  • bump sqlparser-dsql to 0.62.5

DSQL 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 -- --check
  • cargo test --all-features
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo package --allow-dirty

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution under the terms of the project license.

@amaksimo
amaksimo merged commit 923424d into dsql-async-index Aug 26, 2026
19 checks passed
@amaksimo
amaksimo deleted the feat/dsql-drop-column-forms branch August 26, 2026 23:40
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant