Data Access
Also available as:
PDF
loading table of contents...

Viewing Statistics

Use the DESCRIBE statement to view statistics generated by CBO. Include the EXTENDED keyword if you want to include statistics gathered when the hive.stats.fetch.column.stats and hive.compute.query.using.stats properties are enabled.

  • Viewing Generated Table Statistics

    • Use the following syntax to generate table statistics:

      DESCRIBE [EXTENDED] tablename; 
      [Note]Note

      The EXTENDED keyword can be used only if the hive.stats.autogather property is enabled in the hive-site.xml configuration file.

    • The following example displays all statistics for the employees table:

      DESCRIBE EXTENDED employees; 

  • Viewing Generated Column Statistics

    • Use the following syntax to generate column statistics:

      DESCRIBE FORMATTED [dbname.]tablename.columnname; 
    • The following example displays statistics for the region column in the employees table:

      DESCRIBE FORMATTED employees.region; 

[Note]Note

See Statistics in Hive on the Apache website for more information.