Files
impala/testdata/workloads/functional-query/queries/QueryTest/acid-compaction.test
Joe McDonnell 0163a10332 IMPALA-9068: Use different directories for external vs managed warehouse
Hive 3 changed the typical storage model for tables to split them
between two directories:
 - hive.metastore.warehouse.dir stores managed tables (which is now
   defined to be only transactional tables)
 - hive.metastore.warehouse.external.dir stores external tables
   (everything that is not a transactional table)
In more recent commits of Hive, there is now validation that the
external tables cannot be stored in the managed directory. In order
to adopt these newer versions of Hive, we need to use separate
directories for external vs managed warehouses.

Most of our test tables are not transactional, so they would reside
in the external directory. To keep the test changes small, this uses
/test-warehouse for the external directory and /test-warehouse/managed
for the managed directory. Having the managed directory be a subdirectory
of /test-warehouse means that the data snapshot code should not need to
change.

The Hive 2 configuration doesn't change as it does not have this concept.

Since this changes the dataload layout, this also sets the CDH_MAJOR_VERSION
to 7 for USE_CDP_HIVE=true. This means that dataload will uses a separate
location for data as compared to USE_CDP_HIVE=false. That should reduce
conflicts between the two configurations.

Testing:
 - Ran exhaustive tests with USE_CDP_HIVE=false
 - Ran exhaustive tests with USE_CDP_HIVE=true (with current Hive version)
 - Verified that dataload succeeds and tests are able to run with a newer
   Hive version.

Change-Id: I3db69f1b8ca07ae98670429954f5f7a1a359eaec
Reviewed-on: http://gerrit.cloudera.org:8080/15026
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2020-01-24 17:29:15 +00:00

72 lines
1.3 KiB
Plaintext

====
---- HIVE_QUERY
use $DATABASE;
create table tt (x int) tblproperties (
'transactional'='true',
'transactional_properties'='insert_only');
insert into tt values (1);
insert into tt values (2);
insert into tt values (3);
====
---- QUERY
invalidate metadata tt;
select * from tt;
---- RESULTS
1
2
3
====
---- HIVE_QUERY
use $DATABASE;
alter table tt compact 'major' and wait;
====
---- QUERY
refresh tt;
select * from tt
---- RESULTS
1
2
3
====
---- QUERY
show files in tt;
---- LABELS
Path,Size,Partition
---- RESULTS
row_regex:'$NAMENODE/$MANAGED_WAREHOUSE_DIR/$DATABASE.db/tt/base_0000003_v\d+/000000_0','\d+B',''
---- TYPES
STRING,STRING,STRING
====
---- HIVE_QUERY
use $DATABASE;
create table upgraded_table (x int);
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',
'EXTERNAL'='FALSE');
insert into upgraded_table values (2);
insert into upgraded_table values (3);
====
---- QUERY
invalidate metadata upgraded_table;
select * from upgraded_table;
---- RESULTS
1
2
3
====
---- HIVE_QUERY
use $DATABASE;
alter table upgraded_table compact 'major' and wait;
====
---- QUERY
refresh upgraded_table;
select * from upgraded_table;
---- RESULTS
1
2
3
====