Files
impala/testdata/workloads/functional-query/queries/QueryTest/compute-stats-decimal.test
Michael Smith 8b83726b8e IMPALA-9487: Add erasure coding policy to SHOW, DESCRIBE
Adds erasure coding policy to introspection commands SHOW FILES, SHOW
PARTITIONS, SHOW TABLE STATS, and DESCRIBE EXTENDED.

Remove `throws IOException` for methods that don't throw. Removes null
check for getSd because getStorageDescriptorInfo - which is called right
after getTableMetaDataInformation - uses it without checking for null.

Adds '$ERASURECODE_POLICY' for runtime test substitution. The test suite
replaces this with the current erasure code policy - from
HDFS_ERASURECODE_POLICY - or NONE to match expected output.

Testing:
- ran backend, end-to-end, and custom cluster tests with erasure coding
- ran backend, end-to-end, and custom cluster tests with exhaustive
  strategy

Change-Id: Idd95f2d18b3980581788c92993b6d2f53504b5e0
Reviewed-on: http://gerrit.cloudera.org:8080/19268
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Michael Smith <michael.smith@cloudera.com>
2022-12-14 22:37:14 +00:00

65 lines
2.0 KiB
Plaintext

====
---- QUERY
# test compute stats on a partitioned decimal text table
create table decimal_tbl like functional.decimal_tbl;
insert into decimal_tbl partition(d6)
select * from functional.decimal_tbl;
====
---- QUERY
compute stats decimal_tbl
---- RESULTS
'Updated 1 partition(s) and 5 column(s).'
====
---- QUERY
show table stats decimal_tbl
---- LABELS
d6, #Rows, #Files, Size, Bytes Cached, Cache Replication, Format, Incremental Stats, Location, EC POLICY
---- RESULTS
'1',5,1,'375B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*,'$ERASURECODE_POLICY'
'Total',5,1,'375B','0B','','','','',''
---- TYPES
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
show column stats decimal_tbl
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'd1','DECIMAL(9,0)',4,0,4,4,-1,-1
'd2','DECIMAL(10,0)',3,0,8,8,-1,-1
'd3','DECIMAL(20,10)',5,0,16,16,-1,-1
'd4','DECIMAL(38,38)',1,0,16,16,-1,-1
'd5','DECIMAL(10,5)',5,0,8,8,-1,-1
'd6','DECIMAL(9,0)',1,0,4,4,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====
---- QUERY
# test compute stats on a mixed-type parquet table
create table mixed_types(a int, b decimal(10,0)) stored as parquet;
insert into mixed_types values (1, 2), (3, 4);
====
---- QUERY
compute stats mixed_types
---- RESULTS
'Updated 1 partition(s) and 2 column(s).'
====
---- QUERY
show table stats mixed_types
---- LABELS
#Rows, #Files, Size, Bytes Cached, Cache Replication, Format, Incremental Stats, Location, EC POLICY
---- RESULTS
2,1,regex:.+B,'NOT CACHED','NOT CACHED','PARQUET','false',regex:.*,'$ERASURECODE_POLICY'
---- TYPES
BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING, STRING
====
---- QUERY
show column stats mixed_types
---- LABELS
COLUMN, TYPE, #DISTINCT VALUES, #NULLS, MAX SIZE, AVG SIZE, #TRUES, #FALSES
---- RESULTS
'a','INT',2,0,4,4,-1,-1
'b','DECIMAL(10,0)',2,0,8,8,-1,-1
---- TYPES
STRING, STRING, BIGINT, BIGINT, BIGINT, DOUBLE, BIGINT, BIGINT
====