zyxue
zyxue

Reputation: 8820

how to show comment in presto after creating a table?

I created a table like below with some comment

CREATE TABLE some_catalog.some_schema.tmp (
  address VARCHAR COMMENT 'address',
  name VARCHAR COMMENT 'name'
)
COMMENT 'some comment'
;

How could users find the comment when they make a query, describe does NOT show it?

>describe somme_catalog.some_schema.tmp;
presto> describe somme_catalog.somme_schema.tmp;
 Column  |  Type   | Extra | Comment 
---------+---------+-------+---------
 address | varchar |       | address 
 name    | varchar |       | name    
(2 rows)

Also, what is the Extra column for?

I'm using https://prestosql.io/

Upvotes: 0

Views: 1075

Answers (1)

Chananel P
Chananel P

Reputation: 1814

Just write: SHOW CREATE TABLE some_catalog.some_schema.tmp

This will show you pretty much the same command you wrote when creating the table, so you will be able to see the comment as well.

Upvotes: 1

Related Questions