hive> ALTER TABLE emp_dept_partition DROP IF EXISTS PARTITION(deptno=30);
Dropped the partition deptno=30
OK
Time taken: 0.652 seconds
hive> select * from emp_dept_partition where deptno=30;
OK
Time taken: 0.507 seconds
deptno=30分区对应的文件夹也不存在了。
[root@hadoop001 hiveData]# hadoop fs -ls /user/hive/warehouse/emp_dept_partition/
Found 2 items
drwxr-xr-x - root supergroup 0 2018-01-08 20:59 /user/hive/warehouse/emp_dept_partition/deptno=10
drwxr-xr-x - root supergroup 0 2018-01-08 20:59 /user/hive/warehouse/emp_dept_partition/deptno=20