CREATE EXTERNAL TABLE `example`(`axxsdf` string,`mydeailyTime` timestamp)PARTITIONED by (`datetime` string)STORED AS orcfileLOCATION '/home/appleyuchi/example_file';
-- 增加分区(这句话在建立表格后必须执行,否则会导致hive写入ORC文件后,无法被hive读取)
alter table example add partition (dt = '-03-30') location '/xxxx/-03-30';
ALTER TABLE yyyy DROP PARTITION (dt='1919-01-06', area=xxxxxx');
删除分区
Reference:
[1]Hive中LOCATION参数和EXTERNAL参数的关系