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;

相关推荐
螺蛳粉 螺蛳粉3 小时前
大数据第四篇:事故复盘:移走 HBase 里 27 个 hadoop-2.10.2 jar 后,HMaster 半小时后“自杀“了【jar 事故复盘】
jvm·hadoop·hbase·异常处理·大数据运维·踩坑记录·事故复盘
java_logo1 天前
Docker 部署 Hue:轻松搭建数据库与数据仓库 SQL 查询平台
数据库·数据仓库·sql·docker·hue·部署教程·轩辕镜像
Francek Chen1 天前
【大数据处理与分析】数据仓库Hive:08 Impala
数据仓库·hive·hadoop·数据分析·impala
A smirK squirrel1 天前
Windows环境下Minio本地安装部署
数据仓库
ha_lydms2 天前
Window Functions(窗口函数)
大数据·数据仓库·hadoop·spark·数据处理·dataworks·maxcompute
geovindu2 天前
sql:Managing Complex Joins and Subqueries in SQL using mysql 9.0
大数据·数据库·数据仓库·sql·mysql·数据库开发·数据库架构
zhangzeyuaaa2 天前
StarRocks 的技术版图:在分析、检索与流处理之间找到位置
大数据·数据仓库
大鳥2 天前
JSON 解析最佳实践:从入门到生产级优化
hive·sql·spark·json
geovindu2 天前
sql:SQL Views and Materialized Views using mysql 9.0
大数据·数据库·数据仓库·sql·mysql·数据库开发·数据库架构
ha_lydms2 天前
Xml Functions(XML 函数)
xml·大数据·hadoop·spark·数据处理·dataworks·maxcompute