0
創建聲明:通過減少分區的數量改變蜂巢表分區
CREATE EXTERNAL TABLE tab1(usr string)
PARTITIONED BY (year string, month string, day string, hour string, min string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
LOCATION '/tmp/hive1';
數據:
select * from tab1;
jhon,2017,2,20,10,11
jhon,2017,2,20,10,12
jhon,2017,2,20,10,13
現在我需要改變tab1
表只有3個分區(year string, month string, day string)
無需手動複製/修改文件。我有成千上萬的文件,所以我應該只更改表格定義而不觸摸文件?
請讓我知道如何做到這一點?