Mostafa Mokhtar created HIVE-8524:
-------------------------------------
Summary: When table is renamed stats are lost as changes are not
propagated to metastore tables TAB_COL_STATS and PART_COL_STATS
Key: HIVE-8524
URL: https://issues.apache.org/jira/browse/HIVE-8524
Project: Hive
Issue Type: Bug
Components: Metastore
Affects Versions: 0.14.0
Reporter: Mostafa Mokhtar
Assignee: Gunther Hagleitner
Fix For: 0.14.0
When a Hive table is renamed that the name is not updated in TAB_COL_STATS and
PART_COL_STATS.
Repro
1) Create table
2) insert rows
3) Analyze table t1 compute statistics for columns;
4) set hive.stats.fetch.column.stats=true;
5) Explain select * from t1 where c1 > x
6) ALTER TABLE t1 RENAME TO 2;
7) Explain select * from t2 where c1 > x ; /* stats will be missing */
8) Query the Metastore tables to validate
According to the documentation Metastore should be updated
{code}
This statement lets you change the name of a table to a different name.
As of version 0.6, a rename on a managed table moves its HDFS location as well.
(Older Hive versions just renamed the table in the metastore without moving the
HDFS location.)
{code}
Another related issue is that the schema of the stats table is not consistent
with TBLS and DBS as these two table are normalized while TAB_COL_STATS and
PART_COL_STATS have TABLE_NAME and DB_NAME denormalized in them.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)