Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get lastaltertimestamp from Hive table?

Teradata has the concept of lastaltertimestamp, which is the last time an alter table command was executed on a table. lastaltertimestamp can be queried. Does Hive have a similar value that can be queried?

The timestamp returned by hdfs dfs -ls /my/hive/file does not reflect alter table commands, so alter table must not modify the file backing Hive file. describe formatted does not provide a last-alter-timestamp either. Thanks

like image 574
user1332148 Avatar asked Nov 03 '25 12:11

user1332148


1 Answers

Hive stores metadata into a database, so files never get modified. AFAIK the only timestamp which is tracked in HIVE is transient_lastDdlTime.

When table is created it is the time stamp when the table was created. When any DDL is done it is the last DDL time it tooks

You can still add your custom properties to the table in order to track anything you want.

like image 147
ozw1z5rd Avatar answered Nov 06 '25 04:11

ozw1z5rd