How to get DDL or create script of an existing Hive table?
October 25, 2021What is an efficient way to check if a Spark DataFrame is empty?
December 29, 2021Hive by default store all the files behind the Hive table under the warehouse directory. But this location can be overridden during table or later when adding data by altering table using the LOCATION attribute.
Hive warehouse location
Check the warehouse directory for files stored in Hive tables. By default the warehouse directory is /user/hive/warehouse but this can be changed.
Check the hive-site.xml file and hive.metastore.warehouse.dir property for the correct location.
<property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </property>
Location attribute
Hive stores the files under the warehouse directory by default. But this location can be changed during table creating or when loading files at a later location. So make sure to run describe command on the table to know the location.
0: jdbc:hive2://ms2.hirw.com:2181,wk1.hirw.co> describe formatted employee;