试下Inceptor事务表和HDFS目录的关系。

 创建表,并插入数据。

查看目录结构

修改数据'1',和数据'2'的age字段,第三个字段。

 看到了把,出现了9个delta版本文件。因为有了5次插入和4次update。现在执行compact,尽快,在系统compact之前完成。

查看表目录文件情况

查看表目录文件情况

create table test_tx (name string ,id int,age int)clustered by (id) into 4 buckets stored as orc tblproperties('transactional'='true');
insert into test_tx values('1',1,1);  
insert into test_tx values('2',1,1);  
insert into test_tx values('3',1,1);   
insert into test_tx values('4',1,1); 
 insert into test_tx values('5',1,1);
--看下hdfs目录数据,
--sudo -u hive hdfs dfs -ls -h /inceptorsql1/user/hive/warehouse/default.db/hive/test_tx
--看下各个子目录
update test_tx set age=2 where name = '1';
update test_tx set age=2 where name = '2';
update test_tx set age=3 where name = '1';
update test_tx set age=4 where name = '1';
--看下各个子目录
alter table test_tx compact 'minor';
--检查目录
alter table test_tx compact 'major';
原文地址:https://www.cnblogs.com/wifi0/p/7463541.html