Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22073

Add workaround for HIVE-15653 to avoid stats being accidentally wiped

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.2.0
    • None
    • SQL

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            alex.behm Alexander Behm
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: