Files
impala/testdata/workloads/functional-query/queries/QueryTest/hbase-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

171 lines
5.1 KiB
Plaintext

====
---- QUERY
# test computing stats on an HBase table
create table alltypessmall_hbase like functional_hbase.alltypessmall
====
---- QUERY
compute stats alltypessmall_hbase
---- RESULTS
'Updated 1 partition(s) and 13 column(s).'
---- TYPES
STRING
====
---- QUERY
show table stats alltypessmall_hbase
---- LABELS
REGION LOCATION, START ROWKEY, EST. #ROWS, SIZE
---- RESULTS: VERIFY_IS_EQUAL
regex:.+,'',regex:.+,regex:.+B
regex:.+,'1',regex:.+,regex:.+B
regex:.+,'3',regex:.+,regex:.+B
regex:.+,'5',regex:.+,regex:.+B
regex:.+,'7',regex:.+,regex:.+B
regex:.+,'9',regex:.+,regex:.+B
'Total','',regex:.+,regex:.+B
---- TYPES
STRING, STRING, BIGINT, STRING
====
---- QUERY
show column stats alltypessmall_hbase
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'id','INT',99,0,4,4,-1,-1
'bigint_col','BIGINT',10,0,8,8,-1,-1
'bool_col','BOOLEAN',2,0,1,1,50,50
'date_string_col','STRING',12,0,8,8,-1,-1
'double_col','DOUBLE',10,0,8,8,-1,-1
'float_col','FLOAT',10,0,4,4,-1,-1
'int_col','INT',10,0,4,4,-1,-1
'month','INT',4,0,4,4,-1,-1
'smallint_col','SMALLINT',10,0,2,2,-1,-1
'string_col','STRING',10,0,1,1,-1,-1
'timestamp_col','TIMESTAMP',100,0,16,16,-1,-1
'tinyint_col','TINYINT',10,0,1,1,-1,-1
'year','INT',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
# test computing stats on an binary HBase table
create table alltypessmall_hbase_bin like functional_hbase.alltypessmallbinary
====
---- QUERY
compute stats alltypessmall_hbase_bin
---- RESULTS
'Updated 1 partition(s) and 13 column(s).'
---- TYPES
STRING
====
---- QUERY: VERIFY_IS_EQUAL
show table stats alltypessmall_hbase_bin
---- LABELS
REGION LOCATION, START ROWKEY, EST. #ROWS, SIZE
---- RESULTS
regex:.+,'',regex:.+,regex:.+
---- TYPES
STRING, STRING, BIGINT, STRING
====
---- QUERY
show column stats alltypessmall_hbase_bin
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'id','INT',99,0,4,4,-1,-1
'bigint_col','BIGINT',10,0,8,8,-1,-1
'bool_col','BOOLEAN',2,0,1,1,50,50
'date_string_col','STRING',12,0,8,8,-1,-1
'double_col','DOUBLE',10,0,8,8,-1,-1
'float_col','FLOAT',10,0,4,4,-1,-1
'int_col','INT',10,0,4,4,-1,-1
'month','INT',4,0,4,4,-1,-1
'smallint_col','SMALLINT',10,0,2,2,-1,-1
'string_col','STRING',10,0,1,1,-1,-1
'timestamp_col','TIMESTAMP',100,0,16,16,-1,-1
'tinyint_col','TINYINT',10,0,1,1,-1,-1
'year','INT',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
# IMP-1227: Test computing stats on an HBase table that has a
# complex-typed column that Impala does not yet support.
create table allcomplextypes_hbase like functional_hbase.allcomplextypes
====
---- QUERY
compute stats allcomplextypes_hbase
---- RESULTS
'Updated 1 partition(s) and 3 column(s).'
---- TYPES
STRING
====
---- QUERY: VERIFY_IS_EQUAL
show table stats allcomplextypes_hbase
---- LABELS
REGION LOCATION, START ROWKEY, EST. #ROWS, SIZE
---- RESULTS
regex:.+,'',regex:.+,regex:.+
---- TYPES
STRING, STRING, BIGINT, STRING
====
---- QUERY
show column stats allcomplextypes_hbase
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'id','INT',0,0,4,4,-1,-1
'array_array_col','ARRAY<ARRAY<INT>>',-1,-1,-1,-1,-1,-1
'array_map_col','MAP<STRING,ARRAY<INT>>',-1,-1,-1,-1,-1,-1
'complex_nested_struct_col','STRUCT<f1:INT,f2:ARRAY<STRUCT<f11:BIGINT,f12:MAP<STRING,STRUCT<f21:BIGINT>>>>>',-1,-1,-1,-1,-1,-1
'complex_struct_col','STRUCT<f1:INT,f2:ARRAY<INT>,f3:MAP<STRING,INT>>',-1,-1,-1,-1,-1,-1
'int_array_col','ARRAY<INT>',-1,-1,-1,-1,-1,-1
'int_map_col','MAP<STRING,INT>',-1,-1,-1,-1,-1,-1
'int_struct_col','STRUCT<f1:INT,f2:INT>',-1,-1,-1,-1,-1,-1
'map_array_col','ARRAY<MAP<STRING,INT>>',-1,-1,-1,-1,-1,-1
'map_map_col','MAP<STRING,MAP<STRING,INT>>',-1,-1,-1,-1,-1,-1
'month','INT',0,0,4,4,-1,-1
'nested_struct_col','STRUCT<f1:INT,f2:STRUCT<f11:BIGINT,f12:STRUCT<f21:BIGINT>>>',-1,-1,-1,-1,-1,-1
'struct_array_col','ARRAY<STRUCT<f1:BIGINT,f2:STRING>>',-1,-1,-1,-1,-1,-1
'struct_map_col','MAP<STRING,STRUCT<f1:BIGINT,f2:STRING>>',-1,-1,-1,-1,-1,-1
'year','INT',0,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
# test computing stats on an HBase table
create table date_tbl_hbase like functional_hbase.date_tbl
====
---- QUERY
compute stats date_tbl_hbase
---- RESULTS
'Updated 1 partition(s) and 3 column(s).'
---- TYPES
STRING
====
---- QUERY
show table stats date_tbl_hbase
---- LABELS
REGION LOCATION, START ROWKEY, EST. #ROWS, SIZE
---- RESULTS: VERIFY_IS_EQUAL
regex:.+,'',regex:.+,regex:.+B
regex:.+,'1',regex:.+,regex:.+B
regex:.+,'3',regex:.+,regex:.+B
regex:.+,'5',regex:.+,regex:.+B
regex:.+,'7',regex:.+,regex:.+B
regex:.+,'9',regex:.+,regex:.+B
'Total','',regex:.+,regex:.+B
---- TYPES
STRING, STRING, BIGINT, STRING
====
---- QUERY
show column stats date_tbl_hbase
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'id_col','INT',22,0,4,4,-1,-1
'date_col','DATE',16,2,4,4,-1,-1
'date_part','DATE',4,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====