Repository: tobymao/sqlglot

Issue:
selecting from `describe t` using duckdb dialect is incorrect
```
In [7]: import sqlglot.expressions as sge, sqlglot as sg

In [8]: sg.__version__
Out[8]: '25.8.0'

In [9]: sg.parse_one('select * from (describe t)', read="duckdb").sql('duckdb')
Out[9]: 'SELECT * FROM (describe AS t)'
```

DuckDB allows selecting from `DESCRIBE t`:

```
❯ duckdb <<< 'create table t as select 1 as a union select 2; describe t; select column_name from (describe t)'
┌─────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │  null   │   key   │ default │  extra  │
│   varchar   │   varchar   │ varchar │ varchar │ varchar │ varchar │
├─────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ a           │ INTEGER     │ YES     │         │         │         │
└─────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┘
┌─────────────┐
│ column_name │
│   varchar   │
├─────────────┤
│ a           │
└─────────────┘
```

Discussion:

Patch:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index f1681e21..e8a32db0 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -2848,6 +2848,8 @@ class Parser(metaclass=_Parser):
             table = self._match(TokenType.TABLE)
             this = self._parse_select() or self._parse_string() or self._parse_table()
             return self.expression(exp.Summarize, this=this, table=table)
+        elif self._match(TokenType.DESCRIBE):
+            this = self._parse_describe()
         else:
             this = None
 


Test patch:
diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py
index 15af0864..6e37a350 100644
--- a/tests/dialects/test_duckdb.py
+++ b/tests/dialects/test_duckdb.py
@@ -819,6 +819,8 @@ class TestDuckDB(Validator):
 
         self.validate_identity("SELECT LENGTH(foo)")
 
+        self.validate_identity("SELECT * FROM (DESCRIBE t)")
+
     def test_array_index(self):
         with self.assertLogs(helper_logger) as cm:
             self.validate_all(