Files
impala/testdata/workloads/functional-query/queries/QueryTest/clear-statsaccurate.test
Yongzhi Chen dfae1aea54 IMPALA-8839: Remove COLUMN_STATS_ACCURATE from properties
Hive depends on property COLUMN_STATS_ACCURATE to tell if the
stored statistics accurate. After Impala inserts data, it does
not set statistics values up-to-date(for example numRows).
Impala should unset COLUMN_STATS_ACCURATE to tell Hive the
stored stats are no longer accurate.
The patch impletes:
After Impala insert data,
Remove COLUMN_STATS_ACCURATE from table properties if it exists
Remove COLUMN_STATS_ACCURATE from partition params if it exists
Add helper methods to handle alter table/partition for acid
tables.

Implements the stats changes above for both acid/non-acid tables.

Tests:
Manual tests.
Run core tests.
Add ee tests to test interop with Hive for acid/external tables.

Change-Id: I13f4a77022a7112e10a07314359f927eae083deb
Reviewed-on: http://gerrit.cloudera.org:8080/14037
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2019-08-13 18:55:09 +00:00

46 lines
1.3 KiB
Plaintext

====
---- HIVE_QUERY
use $DATABASE;
create external table ext_nopart_colstats (x int);
insert into ext_nopart_colstats values (1);
analyze table ext_nopart_colstats compute statistics for columns;
create external table ext_nopart_colstatschg (x int);
insert into ext_nopart_colstatschg values (1);
analyze table ext_nopart_colstatschg compute statistics for columns;
create external table ext_part_colstats (x int) partitioned by (ds string);
alter table ext_part_colstats add partition (ds='2010-01-01');
alter table ext_part_colstats add partition (ds='2010-01-02');
insert into ext_part_colstats partition (ds='2010-01-01') values (1);
analyze table ext_part_colstats partition(ds='2010-01-01')
compute statistics for columns;
====
---- QUERY
invalidate metadata ext_nopart_colstats;
show create table ext_nopart_colstats;
---- RESULTS
row_regex: .*COLUMN_STATS_ACCURATE.*
====
---- QUERY
invalidate metadata ext_nopart_colstatschg;
insert into ext_nopart_colstatschg values (2);
show create table ext_nopart_colstatschg;
---- RESULTS
row_regex: (?!.*COLUMN_STATS_ACCURATE)
====
---- QUERY
select x from ext_nopart_colstatschg;
---- RESULTS
1
2
====
---- QUERY
invalidate metadata ext_part_colstats;
insert into ext_part_colstats partition (ds='2010-01-01') values (2);
select x from ext_part_colstats where ds='2010-01-01';
---- RESULTS
1
2
---- TYPES
int
====