How can I find last modified timestamp for a table in Hive?

user7375202 picture user7375202 · Jan 4, 2017 · Viewed 21k times · Source

I'm trying to fetch last modified timestamp of a table in Hive.

Answer

satznova picture satznova · Dec 13, 2018

Get the transient_lastDdlTime from your Hive table.

SHOW CREATE TABLE table_name;

Then copy paste the transient_lastDdlTime in below query to get the value as timestamp.

SELECT CAST(from_unixtime(your_transient_lastDdlTime_value) AS timestamp);