如何从Hive表获取lastaltertimestamp? [英] How to get lastaltertimestamp from Hive table?
问题描述
Teradata具有 lastaltertimestamp
的概念,这是最后一次在表上执行 alter table
命令的时间.可以查询 lastaltertimestamp
.Hive是否具有可以查询的相似值?
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?
hdfs dfs -ls/my/hive/file
返回的时间戳不反映 alter table
命令,因此 alter table
不能修改文件支持的Hive文件.描述格式
也不提供最后的时间戳.谢谢
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
推荐答案
Hive将元数据存储到数据库中,因此文件永远不会被修改.AFAIK在HIVE中跟踪的唯一时间戳是 transient_lastDdlTime
.
Hive stores metadata into a database, so files never get modified.
AFAIK the only timestamp which is tracked in HIVE is transient_lastDdlTime
.
创建表时,它是创建表时的时间戳.完成任何DDL后,这是它最后一次DDL时间
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.
这篇关于如何从Hive表获取lastaltertimestamp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!