获取表/分区最后变更时间 https://stackoverflow.com/questions/41468759/how-can-i-find-last-modified-timestamp-for-a-table-in-hive 1 2 3 4 time_column=`beeline --hivevar db=hiveDatabase --hivevar tab=hiveTable --silent=true --showHeader=false --outputformat=tsv2 -e 'show create table ${db}.${tab}' | egrep 'transient_lastDdlTime'` time_value=`echo $time_column | sed 's/[|,)]//g' | awk -F '=' '{print $2}' | sed "s/'//g"` tran_date=`date -d @$time_value +'%Y-%m-%d %H:%M:%S'` echo $tran_date Spark 介绍的 desc EXTENDED 语法 https://spark.apache.org/docs/3.0.0/sql-ref-syntax-aux-describe-table.html 获取表最后变更