Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Incomplete
-
2.2.0
-
None
Description
The alterTable() RPC to the Hive Metastore has the subtle and undesirable side-effect of sometimes wiping/recreating useful stats like 'numRows' and 'totalSize'.
Further, the alterTable() causes extra "hidden" load on the NameNode/S3/whatever to list all the files and get the 'totalSize' and 'numFiles'.
This behavior can lead to confusion, e.g., if a SparkSQL query suddenly becomes slow due to a bad plan because somebody ran an unrelated ALTER TABLE from Hive/SparkSQL which wiped the stats (not fun to do the RCA).
One way to avoid this problem is to always add a special table property DO_NOT_UPDATE_STATS to the altered table before doing the alterTable() RPC to the Metastore.
See HIVE-15653 for more details.