select d.name as db_name
,t.tbl_name as tbl_name
,from_unixtime(min(t.create_time)) as create_time
,min(t.owner) as owner
,min(case when tp.param_key = 'COLUMN_STATS_ACCURATE' then tp.param_value end) as COLUMN_STATS_ACCURATE
,min(case when tp.param_key = 'last_modified_by' then tp.param_value end) as last_modified_by
,min(case when tp.param_key = 'last_modified_time' then from_unixtime(tp.param_value) end) as last_modified_time
,min(case when tp.param_key = 'numFiles' then tp.param_value end) as numFiles
,min(case when tp.param_key = 'numRows' then tp.param_value end) as numRows
,min(case when tp.param_key = 'rawDataSize' then tp.param_value end) as rawDataSize
,min(case when tp.param_key = 'totalSize' then tp.param_value end) as totalSize
,min(case when tp.param_key = 'transient_lastDdlTime' then from_unixtime(tp.param_value) end) as transient_lastDdlTime
from DBS as d
join TBLS as t
on t.db_id = d.db_id
join TABLE_PARAMS as tp
on tp.tbl_id = t.tbl_id
where d.name='tmp_work_db'
group by d.name ,t.tbl_name
order by d.name,t.tbl_name
,t.tbl_name as tbl_name
,from_unixtime(min(t.create_time)) as create_time
,min(t.owner) as owner
,min(case when tp.param_key = 'COLUMN_STATS_ACCURATE' then tp.param_value end) as COLUMN_STATS_ACCURATE
,min(case when tp.param_key = 'last_modified_by' then tp.param_value end) as last_modified_by
,min(case when tp.param_key = 'last_modified_time' then from_unixtime(tp.param_value) end) as last_modified_time
,min(case when tp.param_key = 'numFiles' then tp.param_value end) as numFiles
,min(case when tp.param_key = 'numRows' then tp.param_value end) as numRows
,min(case when tp.param_key = 'rawDataSize' then tp.param_value end) as rawDataSize
,min(case when tp.param_key = 'totalSize' then tp.param_value end) as totalSize
,min(case when tp.param_key = 'transient_lastDdlTime' then from_unixtime(tp.param_value) end) as transient_lastDdlTime
from DBS as d
join TBLS as t
on t.db_id = d.db_id
join TABLE_PARAMS as tp
on tp.tbl_id = t.tbl_id
where d.name='tmp_work_db'
group by d.name ,t.tbl_name
order by d.name,t.tbl_name
As the growth of Big data modernization solutions , it is essential to spread knowledge in people. This meetup will work as a burst of awareness.
ReplyDelete