Files
impala/testdata/workloads/functional-query/queries/QueryTest/acid-compute-stats.test
Chang Wu a93f2c2675 IMPALA-8205: Support number of true and false statistics for boolean column
This change compute the real number of true and false statistics
information for boolean columns. Before this, impala used to set
numTrues and numFalses to hardcoded -1 to indicate that its
statistics is missing.

Test Done:
Append the numTrue and numFalse test for all the statistics-related
test cases including the non-incremental, incremental and other test
cases.

Change-Id: I991bee8e7fdc644d908289f5fe2ee8032cc2c431
Reviewed-on: http://gerrit.cloudera.org:8080/14666
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2020-05-12 23:29:04 +00:00

106 lines
3.0 KiB
Plaintext

====
---- QUERY
# Test unpartitioned table.
set DEFAULT_TRANSACTIONAL_TYPE=insert_only;
create table tt (i int);
insert into tt values (1);
compute stats tt;
====
---- QUERY
show table stats tt;
---- LABELS
#ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
---- RESULTS
1,1,'2B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*
---- TYPES
BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
show column stats tt;
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'i','INT',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
# Test partitioned table with non-incremental stats.
set DEFAULT_TRANSACTIONAL_TYPE=insert_only;
create table pt (x int) partitioned by (p int);
insert into pt partition (p=1) values (1);
compute stats pt;
====
---- QUERY
show table stats pt;
---- LABELS
p, #ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
---- RESULTS
'1',1,1,'2B','NOT CACHED','NOT CACHED',regex:.*,'false',regex:.*
'Total',1,1,'2B','0B','','','',''
---- TYPES
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
show column stats pt;
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'x','INT',1,0,4,4,-1,-1
'p','INT',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
show partitions pt
---- LABELS
p, #ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
---- RESULTS
'1',1,1,'2B','NOT CACHED','NOT CACHED',regex:.*,'false',regex:.*
'Total',1,1,'2B','0B','','','',''
---- TYPES
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
# Test partitioned table with incremental stats.
# DROP STATS is currently not supported for ACID tables, so the tables is dropped and
# recreated instead.
set DEFAULT_TRANSACTIONAL_TYPE=insert_only;
drop table pt;
create table pt (x int) partitioned by (p int);
insert into pt partition (p=1) values (1);
compute incremental stats pt;
====
---- QUERY
show table stats pt;
---- LABELS
p, #ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
---- RESULTS
'1',1,1,'2B','NOT CACHED','NOT CACHED',regex:.*,'true',regex:.*
'Total',1,1,'2B','0B','','','',''
---- TYPES
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
show column stats pt;
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'x','INT',1,0,4,4,-1,-1
'p','INT',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
show partitions pt
---- LABELS
p, #ROWS, #FILES, SIZE, BYTES CACHED, CACHE REPLICATION, FORMAT, INCREMENTAL STATS, LOCATION
---- RESULTS
'1',1,1,'2B','NOT CACHED','NOT CACHED',regex:.*,'true',regex:.*
'Total',1,1,'2B','0B','','','',''
---- TYPES
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
====