hive/doris查询表的创建和更新时间

hive查询表的创建和更新时间:

SELECT

d.NAME AS database_name,

t.TBL_NAME AS table_name,

FROM_UNIXTIME(t.CREATE_TIME) AS create_time,

FROM_UNIXTIME(tp.PARAM_VALUE) AS last_ddl_time

FROM

metastore.TBLS t

JOIN metastore.DBS d ON t.DB_ID = d.DB_ID

JOIN metastore.TABLE_PARAMS tp ON t.TBL_ID = tp.TBL_ID

WHERE

tp.PARAM_KEY = 'transient_lastDdlTime'

and LENGTH(t.TBL_NAME)!=32

and t.TBL_NAME like '%\_%' ;

doris查询表的创建和更新时间

select TABLE_SCHEMA,TABLE_NAME,CREATE_TIME,UPDATE_TIME from information_schema.tables;

hive查询表最近7天创建:

SELECT

d.NAME AS database_name,

t.TBL_NAME AS table_name,

FROM_UNIXTIME(t.CREATE_TIME) AS create_time

FROM

metastore.TBLS t

JOIN metastore.DBS d ON t.DB_ID = d.DB_ID

WHERE

from_unixtime(t.CREATE_TIME, '%Y-%m-%d') > date_sub(curdate(), interval 7 day)

and LENGTH(t.TBL_NAME)!=32

and t.TBL_NAME like '%\_%' ;

doris查询表最近7天创建:

select TABLE_SCHEMA,TABLE_NAME,CREATE_TIME from information_schema.tables where CREATE_TIME >= NOW() - INTERVAL 7 DAY;

相关推荐
鹿衔`17 小时前
Hadoop HDFS 核心机制与设计理念浅析文档
大数据·hadoop·hdfs
`林中水滴`17 小时前
数仓系列:一文读懂仓湖一体架构
数据仓库
Justice Young20 小时前
Sqoop复习笔记
hadoop·笔记·sqoop
大厂技术总监下海20 小时前
从Hadoop MapReduce到Apache Spark:一场由“磁盘”到“内存”的速度与范式革命
大数据·hadoop·spark·开源
zgl_2005377921 小时前
ZGLanguage 解析SQL数据血缘 之 Python提取SQL表级血缘树信息
大数据·数据库·数据仓库·hive·hadoop·python·sql
Justice Young2 天前
Hive第四章:HIVE Operators and Functions
大数据·数据仓库·hive·hadoop
LF3_2 天前
hive,Relative path in absolute URI: ${system:user.name%7D 解决
数据仓库·hive·hadoop
德彪稳坐倒骑驴2 天前
Hive SQL常遗忘的命令
hive·hadoop·sql
Justice Young2 天前
Hive第六章:Hive Optimization and Miscellaneous
数据仓库·hive·hadoop
Justice Young2 天前
Hive第五章:Integeration with HBase
大数据·数据仓库·hive·hbase