mirror of
https://github.com/apache/impala.git
synced 2026-01-01 18:00:30 -05:00
This patch adds a 'location' column to the output of SHOW TABLE STATS / SHOW PARTITIONS. This helps users understand the effects of ALTER TABLE SET LOCATION commands, particularly for partitions, and is easier to identify than the output of DESCRIBE FORMATTED. Some existing tests in alter-table.test have been updated to include checking the location output before and after a SET LOCATION command. The tests in show.test have also been updated to check for the location; all other tests that use SHOW [TABLE STATS|PARTITIONS] use a generic regex to avoid overly verbose tests. Change-Id: I9d276f7b133c38c9319e0906397ca1c31cec95bb Reviewed-on: http://gerrit.cloudera.org:8080/316 Reviewed-by: Henry Robinson <henry@cloudera.com> Tested-by: Internal Jenkins
76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
====
|
|
---- QUERY
|
|
# If the cache directive was deleted outside of Impala, the metadata
|
|
# will not reflect this change until the table is reloaded.
|
|
show table stats cachedb.cached_tbl_reload
|
|
---- RESULTS
|
|
-1,0,'0B','0B','8','TEXT','false',regex:.*
|
|
---- TYPES
|
|
BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
|
|
====
|
|
---- QUERY
|
|
show table stats cachedb.cached_tbl_reload_part
|
|
---- RESULTS
|
|
'1',-1,0,'0B','0B','8','TEXT','false',regex:.*
|
|
'2',-1,0,'0B','0B','8','TEXT','false',regex:.*
|
|
'Total',-1,0,'0B',regex:.+B,'','','',''
|
|
---- TYPES
|
|
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
|
|
====
|
|
---- QUERY
|
|
# Inserting into now uncached partition will not fail, IMPALA-1632
|
|
insert into cachedb.cached_tbl_reload_part partition (j) values (1, 1)
|
|
====
|
|
---- QUERY
|
|
select * from cachedb.cached_tbl_reload_part
|
|
---- RESULTS
|
|
1,1
|
|
---- TYPES
|
|
INT, INT
|
|
====
|
|
---- QUERY
|
|
invalidate metadata cachedb.cached_tbl_reload
|
|
====
|
|
---- QUERY
|
|
invalidate metadata cachedb.cached_tbl_reload_part
|
|
====
|
|
---- QUERY
|
|
invalidate metadata cachedb.no_replication_factor
|
|
====
|
|
---- QUERY
|
|
# Once the metadata is updated, the table no longer appears as cached
|
|
show table stats cachedb.cached_tbl_reload
|
|
---- RESULTS
|
|
-1,0,'0B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*
|
|
---- TYPES
|
|
BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
|
|
====
|
|
---- QUERY
|
|
# The parent test method modified the cached partitioned table so that
|
|
# the cache directive information for the overall table and partition j=1
|
|
# was deleted after reloading the table. Adding a new partition (j=3)
|
|
# will result in adding an uncached partition.
|
|
alter table cachedb.cached_tbl_reload_part add partition (j=3)
|
|
====
|
|
---- QUERY
|
|
# Validate that new partition is uncached.
|
|
show table stats cachedb.cached_tbl_reload_part
|
|
---- RESULTS
|
|
'1',-1,1,regex:.+B,'NOT CACHED','NOT CACHED','TEXT','false',regex:.*
|
|
'2',-1,0,'0B','0B','3','TEXT','false',regex:.*
|
|
'3',-1,0,'0B','NOT CACHED','NOT CACHED','TEXT','false',regex:.*
|
|
'Total',-1,1,regex:.+B,regex:.+B,'','','',''
|
|
---- TYPES
|
|
STRING, BIGINT, BIGINT, STRING, STRING, STRING, STRING, STRING, STRING
|
|
====
|
|
---- QUERY
|
|
# Insert into table without replication factor set in Hive MS, IMPALA-1750
|
|
insert into cachedb.no_replication_factor values (1)
|
|
====
|
|
---- QUERY
|
|
select * from cachedb.no_replication_factor
|
|
---- RESULTS
|
|
1
|
|
---- TYPES
|
|
INT
|
|
==== |