我要清理一组已按以下方式定义的配置单元表:
create table tbl
(
col1 string,
col2 string,
col3 string
)
PARTITIONED BY (col4 string, col5 int)
CLUSTERED BY(col1) into 256 BUCKETS
STORED AS ORC TBLPROPERTIES ('transactional'='true');
我使用了truncate命令:
truncate table mydb.tbl
使用配置单元外壳,如果我尝试计算表中的元素
select count(*) from mydb.tbl
我得到正确的零。但是,如果我尝试计算按分区过滤的元素
select count(*) from mydb.tbl where col4=a and col5=b
然后我得到一个大于零的数。为什么还不归零?我还注意到hdfs文件夹/warehouse/tablespace/managed/hive/mydb/tbl/col4=a/col5=b仍然存在,但它是空的。我也删除了这个文件夹,但选择计数结果仍然不是零。
暂无答案!
目前还没有任何答案,快来回答吧!