mirror of
https://github.com/apache/impala.git
synced 2026-02-01 21:00:29 -05:00
Due to Hive-22158 all non-ACID tables are treated as external tables instead of being managed tables. The ACID tests occasionally upgrade non-ACID tables to ACID tables but that is not allowed for external tables. Since all non-ACID tables are external due to HIVE-22158 some of the ACID tests started to fail after a CDP_BUILD_NUMBER bump that brought in a Hive version containing the mentioned change. The fix is to set 'EXTERNAL' table property to false in the same step when upgrading the table to ACID. Also in the tests this step is executed from HIVE instead of Impala. Tested with the original CDP_BUILD_NUMBER in bin/impala-config.sh and also tested after bumping that number to 1579022. Change-Id: I796403e04b3f06c99131db593473d5438446d5fd Reviewed-on: http://gerrit.cloudera.org:8080/14633 Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Reviewed-by: Gabor Kaszab <gaborkaszab@cloudera.com>
135 lines
2.6 KiB
Plaintext
135 lines
2.6 KiB
Plaintext
====
|
|
---- HIVE_QUERY
|
|
# Create partitioned ACID table in Hive and query it in Impala.
|
|
use $DATABASE;
|
|
create table pt (i int)
|
|
partitioned by (p int) tblproperties (
|
|
'transactional'='true',
|
|
'transactional_properties'='insert_only');
|
|
insert into pt partition (p=1) values (10), (11);
|
|
insert into pt partition (p=2) values (20);
|
|
====
|
|
---- QUERY
|
|
invalidate metadata pt;
|
|
select p, i from pt order by i;
|
|
---- RESULTS
|
|
1,10
|
|
1,11
|
|
2,20
|
|
---- TYPES
|
|
INT,INT
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
insert into pt partition (p=2) values (21);
|
|
====
|
|
---- QUERY
|
|
refresh pt;
|
|
select p, i from pt order by i;
|
|
---- RESULTS
|
|
1,10
|
|
1,11
|
|
2,20
|
|
2,21
|
|
---- TYPES
|
|
INT,INT
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
insert overwrite table pt partition (p=1) values (12);
|
|
insert into pt partition (p=2) values (22);
|
|
====
|
|
---- QUERY
|
|
refresh pt;
|
|
select p, i from pt order by i;
|
|
---- RESULTS
|
|
1,12
|
|
2,20
|
|
2,21
|
|
2,22
|
|
---- TYPES
|
|
INT,INT
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
alter table pt partition(p=2) compact 'major' and wait;
|
|
====
|
|
---- QUERY
|
|
refresh pt;
|
|
select p, i from pt order by i;
|
|
---- RESULTS
|
|
1,12
|
|
2,20
|
|
2,21
|
|
2,22
|
|
---- TYPES
|
|
INT,INT
|
|
====
|
|
---- HIVE_QUERY
|
|
# Create partitioned ACID table and use dynamic partitioning during insert.
|
|
use $DATABASE;
|
|
create table pt_dyn (i int)
|
|
partitioned by (sp int, dp int) tblproperties (
|
|
'transactional'='true',
|
|
'transactional_properties'='insert_only');
|
|
insert into table pt_dyn partition(sp=1, dp) select * from pt;
|
|
insert into table pt_dyn partition(sp=3, dp) select 30, 3;
|
|
====
|
|
---- QUERY
|
|
invalidate metadata pt_dyn;
|
|
select sp, dp, i from pt_dyn order by i;
|
|
---- RESULTS
|
|
1,1,12
|
|
1,2,20
|
|
1,2,21
|
|
1,2,22
|
|
3,3,30
|
|
---- TYPES
|
|
INT,INT,INT
|
|
====
|
|
---- QUERY
|
|
# Create non-ACID partitioned table in Impala and upgrade it to a
|
|
# transactional one in Hive.
|
|
create table upgraded_pt (i int) partitioned by (p int);
|
|
insert into upgraded_pt partition (p=1) values (10);
|
|
insert into upgraded_pt partition (p=2) values (20), (21);
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
alter table upgraded_pt set tblproperties (
|
|
'transactional' = 'true',
|
|
'transactional_properties' = 'insert_only',
|
|
'EXTERNAL' = 'FALSE');
|
|
insert into upgraded_pt partition(p=1) values (11);
|
|
insert into upgraded_pt partition (p=2) values (22);
|
|
====
|
|
---- QUERY
|
|
refresh upgraded_pt;
|
|
select p, i from upgraded_pt order by i;
|
|
---- RESULTS
|
|
1,10
|
|
1,11
|
|
2,20
|
|
2,21
|
|
2,22
|
|
---- TYPES
|
|
INT,INT
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
alter table upgraded_pt partition(p=1) compact 'major' and wait;
|
|
alter table upgraded_pt partition(p=2) compact 'major' and wait;
|
|
====
|
|
---- QUERY
|
|
refresh upgraded_pt;
|
|
select p, i from upgraded_pt order by i;
|
|
---- RESULTS
|
|
1,10
|
|
1,11
|
|
2,20
|
|
2,21
|
|
2,22
|
|
---- TYPES
|
|
INT,INT
|
|
====
|