mirror of
https://github.com/apache/impala.git
synced 2026-01-22 09:01:58 -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>
96 lines
1.8 KiB
Plaintext
96 lines
1.8 KiB
Plaintext
====
|
|
---- HIVE_QUERY
|
|
# Create a table with Hive and run insert, select, and drop from Impala on it.
|
|
use $DATABASE;
|
|
create table tt (x int) tblproperties (
|
|
'transactional'='true',
|
|
'transactional_properties'='insert_only');
|
|
|
|
insert into tt values (1);
|
|
====
|
|
---- QUERY
|
|
invalidate metadata tt;
|
|
select * from tt
|
|
---- RESULTS
|
|
1
|
|
====
|
|
---- HIVE_QUERY
|
|
# Insert from Hive to test refresh table from Impala in the below test.
|
|
use $DATABASE;
|
|
insert into tt values (2);
|
|
====
|
|
---- QUERY
|
|
refresh tt;
|
|
select * from tt order by x;
|
|
---- RESULTS
|
|
1
|
|
2
|
|
====
|
|
---- QUERY
|
|
# Do a second refresh on an already refreshed ACID table.
|
|
refresh tt;
|
|
select * from tt order by x;
|
|
---- RESULTS
|
|
1
|
|
2
|
|
====
|
|
---- QUERY
|
|
insert overwrite table tt values (3);
|
|
insert into tt values (4);
|
|
====
|
|
---- QUERY
|
|
refresh tt;
|
|
select * from tt order by x;
|
|
---- RESULTS
|
|
3
|
|
4
|
|
====
|
|
---- QUERY
|
|
create table upgraded_table (x int);
|
|
insert into upgraded_table values (1);
|
|
====
|
|
---- HIVE_QUERY
|
|
use $DATABASE;
|
|
# Upgrade to the table to insert only acid when there are already values in it.
|
|
alter table upgraded_table set tblproperties
|
|
('transactional' = 'true', 'transactional_properties' = 'insert_only',
|
|
'EXTERNAL' = 'FALSE');
|
|
====
|
|
---- QUERY
|
|
refresh upgraded_table;
|
|
insert into upgraded_table values (2);
|
|
insert into upgraded_table values (3);
|
|
====
|
|
---- QUERY
|
|
select * from upgraded_table;
|
|
---- RESULTS
|
|
1
|
|
2
|
|
3
|
|
====
|
|
---- QUERY
|
|
drop table tt;
|
|
show tables;
|
|
---- RESULTS
|
|
'upgraded_table'
|
|
====
|
|
---- QUERY
|
|
# After dropping the table I re-create and drop it again to check that all the locks
|
|
# are released properly from HMS.
|
|
create table tt (x int) tblproperties (
|
|
'transactional'='true',
|
|
'transactional_properties'='insert_only');
|
|
====
|
|
---- QUERY
|
|
show tables;
|
|
---- RESULTS
|
|
'upgraded_table'
|
|
'tt'
|
|
====
|
|
---- QUERY
|
|
drop table tt;
|
|
show tables;
|
|
---- RESULTS
|
|
'upgraded_table'
|
|
====
|