Repository: hive Updated Branches: refs/heads/master 15bdce43d -> 58d820368
HIVE-13792: Show create table should not show stats info in the table properties (Reviewed by Chaoyu Tang) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/58d82036 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/58d82036 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/58d82036 Branch: refs/heads/master Commit: 58d820368517ab2e29e2467feea10ad799cf1cbb Parents: 15bdce4 Author: Aihua Xu <aihu...@apache.org> Authored: Fri May 20 09:24:59 2016 -0400 Committer: Aihua Xu <aihu...@apache.org> Committed: Sat May 28 20:40:57 2016 -0400 ---------------------------------------------------------------------- .../hadoop/hive/common/StatsSetupConst.java | 4 ++++ .../test/results/positive/hbase_queries.q.out | 5 ---- .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 1 + .../results/clientpositive/nullformat.q.out | 5 ---- .../results/clientpositive/nullformatCTAS.q.out | 5 ---- .../show_create_table_alter.q.out | 25 -------------------- .../show_create_table_db_table.q.out | 5 ---- .../show_create_table_serde.q.out | 20 ---------------- 8 files changed, 5 insertions(+), 65 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/common/src/java/org/apache/hadoop/hive/common/StatsSetupConst.java ---------------------------------------------------------------------- diff --git a/common/src/java/org/apache/hadoop/hive/common/StatsSetupConst.java b/common/src/java/org/apache/hadoop/hive/common/StatsSetupConst.java index 1466b69..01e6010 100644 --- a/common/src/java/org/apache/hadoop/hive/common/StatsSetupConst.java +++ b/common/src/java/org/apache/hadoop/hive/common/StatsSetupConst.java @@ -137,6 +137,10 @@ public class StatsSetupConst { public static final String FALSE = "false"; + // The parameter keys for the table statistics. Those keys are excluded from 'show create table' command output. + public static final String[] TABLE_PARAMS_STATS_KEYS = new String[] { + COLUMN_STATS_ACCURATE, NUM_FILES, TOTAL_SIZE,ROW_COUNT, RAW_DATA_SIZE, NUM_PARTITIONS}; + public static boolean areBasicStatsUptoDate(Map<String, String> params) { String statsAcc = params.get(COLUMN_STATS_ACCURATE); if (statsAcc == null) { http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/hbase-handler/src/test/results/positive/hbase_queries.q.out ---------------------------------------------------------------------- diff --git a/hbase-handler/src/test/results/positive/hbase_queries.q.out b/hbase-handler/src/test/results/positive/hbase_queries.q.out index 8aa5f84..a99f561 100644 --- a/hbase-handler/src/test/results/positive/hbase_queries.q.out +++ b/hbase-handler/src/test/results/positive/hbase_queries.q.out @@ -917,12 +917,7 @@ WITH SERDEPROPERTIES ( 'hbase.columns.mapping'='cf:string', 'serialization.format'='1') TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', 'hbase.table.name'='hbase_table_0', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: DROP TABLE IF EXISTS hbase_table_9 PREHOOK: type: DROPTABLE http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 00bff6b..755654c 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -2209,6 +2209,7 @@ public class DDLTask extends Task<DDLWork> implements Serializable { String tbl_location = " '" + escapeHiveCommand(sd.getLocation()) + "'"; // Table properties + duplicateProps.addAll(Arrays.asList(StatsSetupConst.TABLE_PARAMS_STATS_KEYS)); String tbl_properties = propertiesToString(tbl.getParameters(), duplicateProps); createTab_stmt.add(TEMPORARY, tbl_temp); http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/test/results/clientpositive/nullformat.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/nullformat.q.out b/ql/src/test/results/clientpositive/nullformat.q.out index 2a80359..af91470 100644 --- a/ql/src/test/results/clientpositive/nullformat.q.out +++ b/ql/src/test/results/clientpositive/nullformat.q.out @@ -93,11 +93,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: -- load null data from another table and verify that the null is stored in the expected format INSERT OVERWRITE TABLE null_tab1 SELECT a,b FROM base_tab http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/test/results/clientpositive/nullformatCTAS.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/nullformatCTAS.q.out b/ql/src/test/results/clientpositive/nullformatCTAS.q.out index 7686419..ea51a56 100644 --- a/ql/src/test/results/clientpositive/nullformatCTAS.q.out +++ b/ql/src/test/results/clientpositive/nullformatCTAS.q.out @@ -176,11 +176,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='1', - 'numRows'='10', - 'rawDataSize'='70', - 'totalSize'='80', #### A masked pattern was here #### 1.01 1.01 http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/test/results/clientpositive/show_create_table_alter.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/show_create_table_alter.q.out b/ql/src/test/results/clientpositive/show_create_table_alter.q.out index d09f30b..d1c1a53 100644 --- a/ql/src/test/results/clientpositive/show_create_table_alter.q.out +++ b/ql/src/test/results/clientpositive/show_create_table_alter.q.out @@ -35,11 +35,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: -- Add a comment to the table, change the EXTERNAL property, and test SHOW CREATE TABLE on the change. ALTER TABLE tmp_showcrt1 SET TBLPROPERTIES ('comment'='temporary table', 'EXTERNAL'='FALSE') @@ -77,11 +72,6 @@ LOCATION TBLPROPERTIES ( 'EXTERNAL'='FALSE', #### A masked pattern was here #### - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', -#### A masked pattern was here #### PREHOOK: query: -- Alter the table comment, change the EXTERNAL property back and test SHOW CREATE TABLE on the change. ALTER TABLE tmp_showcrt1 SET TBLPROPERTIES ('comment'='changed comment', 'EXTERNAL'='TRUE') PREHOOK: type: ALTERTABLE_PROPERTIES @@ -117,11 +107,6 @@ LOCATION #### A masked pattern was here #### TBLPROPERTIES ( #### A masked pattern was here #### - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', -#### A masked pattern was here #### PREHOOK: query: -- Change the 'SORTBUCKETCOLSPREFIX' property and test SHOW CREATE TABLE. The output should not change. ALTER TABLE tmp_showcrt1 SET TBLPROPERTIES ('SORTBUCKETCOLSPREFIX'='FALSE') PREHOOK: type: ALTERTABLE_PROPERTIES @@ -157,11 +142,6 @@ LOCATION #### A masked pattern was here #### TBLPROPERTIES ( #### A masked pattern was here #### - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', -#### A masked pattern was here #### PREHOOK: query: -- Alter the storage handler of the table, and test SHOW CREATE TABLE. ALTER TABLE tmp_showcrt1 SET TBLPROPERTIES ('storage_handler'='org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler') PREHOOK: type: ALTERTABLE_PROPERTIES @@ -197,11 +177,6 @@ LOCATION #### A masked pattern was here #### TBLPROPERTIES ( #### A masked pattern was here #### - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', -#### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_showcrt1 PREHOOK: type: DROPTABLE PREHOOK: Input: default@tmp_showcrt1 http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/test/results/clientpositive/show_create_table_db_table.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/show_create_table_db_table.q.out b/ql/src/test/results/clientpositive/show_create_table_db_table.q.out index daf63e9..495f4b5 100644 --- a/ql/src/test/results/clientpositive/show_create_table_db_table.q.out +++ b/ql/src/test/results/clientpositive/show_create_table_db_table.q.out @@ -46,11 +46,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_feng.tmp_showcrt PREHOOK: type: DROPTABLE http://git-wip-us.apache.org/repos/asf/hive/blob/58d82036/ql/src/test/results/clientpositive/show_create_table_serde.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/show_create_table_serde.q.out b/ql/src/test/results/clientpositive/show_create_table_serde.q.out index a7bcb44..44414b2 100644 --- a/ql/src/test/results/clientpositive/show_create_table_serde.q.out +++ b/ql/src/test/results/clientpositive/show_create_table_serde.q.out @@ -41,11 +41,6 @@ LOCATION #### A masked pattern was here #### TBLPROPERTIES ( #### A masked pattern was here #### - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', -#### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_showcrt1 PREHOOK: type: DROPTABLE PREHOOK: Input: default@tmp_showcrt1 @@ -92,11 +87,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_showcrt1 PREHOOK: type: DROPTABLE @@ -146,11 +136,6 @@ OUTPUTFORMAT LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_showcrt1 PREHOOK: type: DROPTABLE @@ -195,11 +180,6 @@ WITH SERDEPROPERTIES ( LOCATION #### A masked pattern was here #### TBLPROPERTIES ( - 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', - 'numFiles'='0', - 'numRows'='0', - 'rawDataSize'='0', - 'totalSize'='0', #### A masked pattern was here #### PREHOOK: query: DROP TABLE tmp_showcrt1 PREHOOK: type: DROPTABLE