I have created a table couple months ago. Is there any way in HIVE that I can see when was the table created?
show table doesn't give the date creation of the table.
I have created a table couple months ago. Is there any way in HIVE that I can see when was the table created?
show table doesn't give the date creation of the table.
Execute the command desc formatted <database>.<table_name>
on the hive cli. It will show detailed table information similar to
Detailed Table Information
Database:
Owner:
CreateTime:
LastAccessTime:
You need to run the following command:
describe formatted <your_table_name>;
Or if you need this information about a particular partition:
describe formatted <your_table_name> partition (<partition_field>=<value>);
db_name.table_name
partition (acquisition_date = '2021-10-07', acquisition_hour = '07'); –
Vibrio First of all, enable hive support when you create your spark session:
spark = SparkSession.builder.appName('AppName').enableHiveSupport().getOrCreate()
And then:
df_desc = spark.sql('describe formatted <your_table_name>')
df_desc.show()
© 2022 - 2024 — McMap. All rights reserved.