解釋:就是多級資料夾
1.建立二級分割槽表
hive (default)> create table dept_partition2(dept.txt檔案的建立方法鏈結deptno int, dname string, loc string
)partitioned by (month string, day string)
row format delimited fields terminated by 『\t』;
2.載入資料到分割槽表中
hive (default)>hive (default)> load data local inpath 『/opt/moudles/cdh/hive-0.13.1-cdh5.3.6/input/dept.txt』 into table dept_partition2 partition (month=『20190928』,day=『01』);3.命令檢視 (詳細資訊)
/user/hive/warehouse是我配置的hive倉庫目錄
hive (default)> dfs -ls /user/hive/warehouse/dept_partition2/month=20190928;
found 2 items
drwxr-xr-x - admin supergroup 0 2019-09-23 08:51 /user/hive/warehouse/dept_partition2/month=20190928/day=01
drwxr-xr-x - admin supergroup 0 2019-09-23 08:50 /user/hive/warehouse/dept_partition2/month=20190928/day=02
3.命令檢視 (粗略資訊)hive (default)> hive (default)> show partitions dept_partition2;
ok
month=20190928/day=01
month=20190928/day=02
time taken: 0.038 seconds, fetched: 2 row(s)
4. 查詢分割槽資料hive (default)> select * from dept_partition2 where month=20190928 and day=01;
hive 分割槽表 Hive的DDL分割槽表建立
1.單分割槽表 建立表t user,指定分割槽hive xiaoliu create table t user id int,name string partitioned by country string row format delimited fields terminated by xia...
hive 建立分割槽表
必須在表定義時建立partition a 單分割槽建表語句 create table day table id int,content string partitioned by dt string 單分割槽表,按天分割槽,在表結構中存在id,content,dt三列。以dt為資料夾區分 b 雙分割...
hive建立分割槽表
靜態分割槽去掉源資料分割槽列後執行 記得指定ymd 2019 10 10 1.建立分割槽表 create tabletemp pilesmallint,mp smallint,carownerint,hmsint partitioned by ymd int row format delimited...