Allow ALTER TABLE to set per-partition serde and table properties.

The main motivation is to allow users to set the per-partition number
of rows for manual incremental stats maintenance, as well as a means
to 'drop' stats that may have caused undesirable plan changes.

Change-Id: Iff38317a993e5d7952ea4df839947f5ec341e930
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1010
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
This commit is contained in:
Alex Behm
2013-12-02 19:03:22 -08:00
committed by Henry Robinson
parent bfb16ff552
commit 24662b1941
8 changed files with 129 additions and 49 deletions

View File

@@ -540,3 +540,38 @@ group by int_col order by 1 limit 100
---- TYPES
int,bigint
====
---- QUERY
# Show the table stats before altering.
show table stats alltypes_test
---- LABELS
YEAR, MONTH, #ROWS, #FILES, SIZE, FORMAT
---- RESULTS
2009,4,-1,1,regex:.+KB,'SEQUENCE_FILE'
2009,5,-1,1,regex:.+KB,'RC_FILE'
Total,,-1,2,regex:.+KB,''
---- TYPES
INT, INT, BIGINT, BIGINT, STRING, STRING
====
---- QUERY
# Test altering the 'numRows' table property of a table.
alter table alltypes_test set tblproperties ('numRows'='200')
---- RESULTS
====
---- QUERY
# Test altering the 'numRows' table property of a partition.
alter table alltypes_test partition(year=2009, month=4)
set tblproperties ('numRows'='30')
---- RESULTS
====
---- QUERY
# Show the table stats after altering the table and partition stats.
show table stats alltypes_test
---- LABELS
YEAR, MONTH, #ROWS, #FILES, SIZE, FORMAT
---- RESULTS
2009,4,30,1,regex:.+KB,'SEQUENCE_FILE'
2009,5,-1,1,regex:.+KB,'RC_FILE'
Total,,200,2,regex:.+KB,''
---- TYPES
INT, INT, BIGINT, BIGINT, STRING, STRING
====