Find table's size in Hive metastore (MySQL)
I have some tables in hive and I want to find the size of each table through the metastore (MySQL).
I am trying the below but it returns paratition_params, notification_log, sds etc. My tables are stored in TABLES.TBLS but when I am running the below query with from information_schema.TABLES.TBLS it returns this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.TBLS
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC
LIMIT 0, 200' at line 5
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;

