在Hive中显示tblproperties命令会给出不正确的结果

问题描述 投票:1回答:1

当我运行show tblproperties sometblname时,我得到:

  • numRows = -1
  • 罗德兹= -1
  • totalSize = 0
  • COLUMN_STATS_ACCURATE = false

但我的表中有数据。有没有理由tblproperties显示不同的东西?

sql hive
1个回答
1
投票

只需运行ANALYSE TABLE,语法:

ANALYZE TABLE [db_name.]tablename [PARTITION(partcol1[=val1], partcol2[=val2], ...)]
  COMPUTE STATISTICS 
  [FOR COLUMNS]          -- (Note: Hive 0.10.0 and later.)
  [CACHE METADATA]       -- (Note: Hive 2.1.0 and later.)
  [NOSCAN];

当用户发出该命令但未指定任何分区规范时,将为该表以及所有分区(如果有)收集统计信息。

参考:Existing Tables – ANALYZE

© www.soinside.com 2019 - 2024. All rights reserved.