Repository: sqlfluff/sqlfluff
Issue category: Bug Report

"ALTER TABLE foo DROP COLUMN bar" syntax not supported in Databricks dialect
### Search before asking

- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/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

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)



Functions to edit:
src/sqlfluff/dialects/dialect_databricks.py:AlterTableStatementSegment

Patch:
diff --git a/src/sqlfluff/dialects/dialect_databricks.py b/src/sqlfluff/dialects/dialect_databricks.py
index 8f1bdc065d3..a9d25aff2f3 100644
--- a/src/sqlfluff/dialects/dialect_databricks.py
+++ b/src/sqlfluff/dialects/dialect_databricks.py
@@ -19,6 +19,7 @@
     Indent,
     Matchable,
     OneOf,
+    OptionallyBracketed,
     Ref,
     RegexLexer,
     RegexParser,
@@ -831,7 +832,7 @@ class AlterTableStatementSegment(sparksql.AlterTableStatementSegment):
                 "DROP",
                 OneOf("COLUMN", "COLUMNS", optional=True),
                 Ref("IfExistsGrammar", optional=True),
-                Bracketed(
+                OptionallyBracketed(
                     Delimited(
                         Ref("ColumnReferenceSegment"),
                     ),

Test patch: diff --git a/test/fixtures/dialects/databricks/alter_table.sql b/test/fixtures/dialects/databricks/alter_table.sql
index 666bf54614e..4399cdac99d 100644
--- a/test/fixtures/dialects/databricks/alter_table.sql
+++ b/test/fixtures/dialects/databricks/alter_table.sql
@@ -85,3 +85,11 @@ ALTER TABLE persons DROP CONSTRAINT persons_pk RESTRICT;
 ALTER TABLE pets DROP FOREIGN KEY IF EXISTS  (owner_first_name, owner_last_name);
 
 ALTER TABLE persons DROP PRIMARY KEY CASCADE;
+
+ALTER TABLE rocks DROP COLUMN rock;
+
+ALTER TABLE rocks DROP COLUMN rock, loc;
+
+ALTER TABLE rocks DROP COLUMN IF EXISTS rock, loc;
+
+ALTER TABLE rocks DROP COLUMN IF EXISTS (rock, loc);
diff --git a/test/fixtures/dialects/databricks/alter_table.yml b/test/fixtures/dialects/databricks/alter_table.yml
index e8826d62272..388f9fb8284 100644
--- a/test/fixtures/dialects/databricks/alter_table.yml
+++ b/test/fixtures/dialects/databricks/alter_table.yml
@@ -3,7 +3,7 @@
 # computed by SQLFluff when running the tests. Please run
 # `python test/generate_parse_fixture_yml.py`  to generate them after adding or
 # altering SQL files.
-_hash: 14321de384783dc7ad2bc136679d798bd154f1146fef04e38031e968867f558e
+_hash: 03f768cfcb2f61768ed9558a86a0084ac2900341415c8b041889f9386970f3b9
 file:
 - statement:
     alter_table_statement:
@@ -693,3 +693,63 @@ file:
     - keyword: KEY
     - keyword: CASCADE
 - statement_terminator: ;
+- statement:
+    alter_table_statement:
+    - keyword: ALTER
+    - keyword: TABLE
+    - table_reference:
+        naked_identifier: rocks
+    - keyword: DROP
+    - keyword: COLUMN
+    - column_reference:
+        naked_identifier: rock
+- statement_terminator: ;
+- statement:
+    alter_table_statement:
+    - keyword: ALTER
+    - keyword: TABLE
+    - table_reference:
+        naked_identifier: rocks
+    - keyword: DROP
+    - keyword: COLUMN
+    - column_reference:
+        naked_identifier: rock
+    - comma: ','
+    - column_reference:
+        naked_identifier: loc
+- statement_terminator: ;
+- statement:
+    alter_table_statement:
+    - keyword: ALTER
+    - keyword: TABLE
+    - table_reference:
+        naked_identifier: rocks
+    - keyword: DROP
+    - keyword: COLUMN
+    - keyword: IF
+    - keyword: EXISTS
+    - column_reference:
+        naked_identifier: rock
+    - comma: ','
+    - column_reference:
+        naked_identifier: loc
+- statement_terminator: ;
+- statement:
+    alter_table_statement:
+    - keyword: ALTER
+    - keyword: TABLE
+    - table_reference:
+        naked_identifier: rocks
+    - keyword: DROP
+    - keyword: COLUMN
+    - keyword: IF
+    - keyword: EXISTS
+    - bracketed:
+      - start_bracket: (
+      - column_reference:
+          naked_identifier: rock
+      - comma: ','
+      - column_reference:
+          naked_identifier: loc
+      - end_bracket: )
+- statement_terminator: ;