Created
July 30, 2019 10:50
-
-
Save adidonato/ce99868390d8de3c615d8a0830191493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Usage: ./show_last_updated_hive_table.sh #tablename" | |
time_column=`hive -e "show create table $1" | 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment