IMPALA-9093: Change ACID tests to upgrade external tables
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>
diff --git a/testdata/workloads/functional-query/queries/QueryTest/acid-compaction.test b/testdata/workloads/functional-query/queries/QueryTest/acid-compaction.test
index 608c2af..c72be6d 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/acid-compaction.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/acid-compaction.test
@@ -44,7 +44,8 @@
insert into upgraded_table values (1);
# 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');
+ ('transactional' = 'true', 'transactional_properties' = 'insert_only',
+ 'EXTERNAL'='FALSE');
insert into upgraded_table values (2);
insert into upgraded_table values (3);
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/acid-partitioned.test b/testdata/workloads/functional-query/queries/QueryTest/acid-partitioned.test
index aae1972..204828d 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/acid-partitioned.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/acid-partitioned.test
@@ -98,7 +98,8 @@
use $DATABASE;
alter table upgraded_pt set tblproperties (
'transactional' = 'true',
- 'transactional_properties' = 'insert_only');
+ 'transactional_properties' = 'insert_only',
+ 'EXTERNAL' = 'FALSE');
insert into upgraded_pt partition(p=1) values (11);
insert into upgraded_pt partition (p=2) values (22);
====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/acid.test b/testdata/workloads/functional-query/queries/QueryTest/acid.test
index 2939685..b30763f 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/acid.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/acid.test
@@ -48,9 +48,16 @@
---- 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');
+ ('transactional' = 'true', 'transactional_properties' = 'insert_only',
+ 'EXTERNAL' = 'FALSE');
+====
+---- QUERY
+refresh upgraded_table;
insert into upgraded_table values (2);
insert into upgraded_table values (3);
====