Skip to content

Latest commit

 

History

History
49 lines (46 loc) · 829 Bytes

5-DynamicPartitioning.md

File metadata and controls

49 lines (46 loc) · 829 Bytes

Dynamic partitioning

  • On hive shell: set some properties to enable dynamic partitioning

SET hive.exec.dynamic.partition.mode=nonstrict;

  • On Hive shell: populate all partitions of the partitioned table from the unpartitioned table

INSERT OVERWRITE TABLE flight_data_p PARTITION(month)
SELECT
   year,
   day,
   day_of_week,
   dep_time,
   crs_dep_time,
   arr_time,
   crs_arr_time,
   unique_carrier,
   flight_num,
   tail_num,
   actual_elapsed_time,
   crs_elapsed_time,
   air_time,
   arr_delay,
   dep_delay,
   origin,
   dest,
   distance,
   taxi_in,
   taxi_out,
   cancelled,
   cancellation_code,
   diverted,
   carrier_delay,
   weather_delay,
   nas_delay,
   security_delay,
   late_aircraft_delay,
   month
FROM
   flight_data;