How to get whether the table is partitioned by dynamic or static in hive How to get whether the table is partitioned by dynamic or static in hive hadoop hadoop

How to get whether the table is partitioned by dynamic or static in hive


There is no difference between dynamic and static partitions. This is how partitions were created. Dynamic - means partitions were created usinginsert overwrite table partition (partition_column) select ... statement (without partition value specified) execution.

Static means that partitions were created using alter table add partition... statement or using the same insert overwrite table partition (partition_column='static value') statement . There is no such attribute in metadata because there is no difference between partitions created using INSERT (dynamic or static) or ALTER (static). It's possible to create partitions dynamically in table in which partitions were already created statically and vice-versa, absolutely no difference.

Also you can add partitions using ALTER TABLE RECOVER PARTITIONS., partitions created by this statement are the same partitions, impossible to differentiate from partitions created by other means.