Query the table parameters property inside the system database to extract catalog
descriptions.
When you need to find the specific comment or configuration parameters of a table,
you can retrieve this metadata from the TABLE_PARAMS table
inside the sys database instead of accessing the backend database directly.
Ensure that you have access permissions to run the beeline client.
-
Open your terminal interface and run the beeline client.
-
Select the system database by running the following command:
-
Extract the table comments by running the following metadata query:
SELECT
d.name AS db_name,
t.tbl_name AS tbl_name,
max(CASE WHEN p.param_key = 'comment' THEN p.param_value END) AS table_comment
FROM DBS d
JOIN TBLS t
ON d.db_id = t.db_id
LEFT JOIN TABLE_PARAMS p
ON p.tbl_id = t.tbl_id
WHERE t.tbl_type <> 'VIRTUAL_VIEW'
AND lower(d.name) NOT IN ('sys', 'information_schema')
GROUP BY d.name, t.tbl_name
ORDER BY db_name, tbl_name;