1. 程式人生 > >Hive建立外部分割槽表

Hive建立外部分割槽表

drop table if exists employee;
create external table employee (
    name            string,
    salary          float,
    subordinates    array<string>,
    deductions      map<string, float>,
    address         struct<country:string, street:string, city:string, state:string, zip:int
> ) PARTITIONED BY(country string, state string) row format delimited fields terminated by '\033' location '/db/hive_prog/';

注意:partition一定要在第一個屬性