简体   繁体   中英

Add a dynamic partiton in in a static partition in a nested partition table?

I have a table that has nested partitions like -

  • country1
    • run date 1
    • run date 2
  • country2
    • run date 1
    • run date 2

I need to add the first layer(country) statically (as they are in different locations) but want the 2nd layer(run dates) to be added dynamically.

I have tried below but its not working-

ALTER TABLE <table_name> ADD PARTITION (country=country1, run_date) LOCATION '<path>';

I don't think there is dynamic partition option in alter table for hive.

However what I understand from your requirement may be something like below.

insert into nested_part partition(country='count1',run_date) select name,id,run_date from source4_nesting where country='count1';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM