8000 "ALTER TABLE foo DROP COLUMN bar" syntax not supported in Databricks dialect · Issue #6457 · sqlfluff/sqlfluff · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

"ALTER TABLE foo DROP COLUMN bar" syntax not supported in Databricks dialect #6457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 3 tasks
KenHBS opened this issue Nov 14, 2024 · 0 comments · Fixed by #6461
Closed
2 of 3 tasks

"ALTER TABLE foo DROP COLUMN bar" syntax not supported in Databricks dialect #6457

KenHBS opened this issue Nov 14, 2024 · 0 comments · Fixed by #6461
Labels
bug Something isn't working databricks

Comments

@KenHBS
Copy link
KenHBS commented Nov 14, 2024

Search before asking

  • I searched the issues and found no similar issues.

What Happened

When linting ALTER TABLE foo DROP COLUMN bar; using the Databricks dialect, I get

Found unparsable section: 'COLUMN bar;'

According to the Databricks documentation, this syntax is allowed: https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-alter-table-manage-column.html#required-permissions

Expected Behaviour

I expect the linting to pass:

sqlfluff lint test.sql --dialect=databricks

Observed Behaviour

The linting fails due to an unparseable section:

Found unparsable section: 'COLUMN bar;'

How to reproduce

echo "ALTER TABLE foo DROP COLUMN bar;" > test.sql
sqlfluff lint test.sql --dialect=databricks

fails, but

sqlfluff lint test.sql --dialect=mysql

works

Dialect

This happens in Databricks SQL. In some other dialects, however, this syntax is supported.

I tried mysql, snowflake and clickhouse. They all work fine. This syntax was implemented for those dialects recently in #6348 , but it looks like Databricks SQL was not included in that PR.

Version

3.2.5

Configuration

dialect = "databricks"
templater = "jinja"
max_line_length = 150

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

@KenHBS KenHBS added the bug Something isn't working label Nov 14, 2024
@KenHBS KenHBS changed the title ALTER TABLE foo DROP COLUMN bar syntax not supported in Databricks dialect "ALTER TABLE foo DROP COLUMN bar" syntax not supported in Databricks dialect Nov 14, 2024
fstg1992 pushed a commit to fstg1992/sqlfluff that referenced this issue Nov 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 21, 2024
Co-authored-by: F STG <fritz.steingrube@extern.stromnetz-hamburg.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working databricks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0