trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.34k stars 2.98k forks source link

Table in SHOW COLUMNS IN is optional #20271

Closed ruixiad closed 9 months ago

ruixiad commented 9 months ago

Hey there,

By checking Trino implementation on SHOW COLUMNS IN, table is optional: https://github.com/trinodb/trino/blob/master/core/trino-grammar/src/main/antlr4/io/trino/grammar/sql/SqlBase.g4#L163. However, from the public doc: https://trino.io/docs/current/sql/show-columns.html, it seems table is required.

Compared with Presto implementation: https://github.com/prestodb/presto/blob/master/presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4, table is required. Is this a missing in Trino grammar or intentional? If it is intentional, may I know why that is the case?

ebyhr commented 9 months ago

The table name is required. https://github.com/trinodb/trino/pull/20280 removed ? from SqlBase.g4 file.