--创建外部表
CREATE EXTERNAL TABLE my_report(
last_update string,
col_a string)
PARTITIONED BY (
par_dt string)ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,‘ location ‘/user/hive/warehouse/zyz.db/my_report‘;
-----添加分区
alter table my_daily_report add partition (par_dt=‘20170101‘) location ‘/user/hive/warehouse/zyz.db/my_report/20170101‘;
--上传测试数据
[[email protected] ~]$cat test.txt
20160101,zyz
[[email protected] ~]hadoop fs -put ./test.txt /user/hive/warehouse/zyz.db/my_report/20170101/
时间: 2024-10-11 03:32:41