creating partition in external table in hive

后端 未结 4 1367

I have successfully created and added Dynamic partitions in an Internal table in hive. i.e. by using following steps:

1-created a sourc

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-03 11:59

    The proper way to do it.

    1. Create the table and mention it is partitioned.

      create external table1 ( name string, age int, height int) partitioned by (age int) stored as ****(your format) location 'path/to/dataFile/in/HDFS';

    2. Now you have to refresh the partitions in the hive metastore.

      msck repair table table1

    This will take care of loading all your partitions into the hive metastore.

    You can use msck repair table at any point during your process to have the metastore updated.

提交回复
热议问题