Github user wzhfy commented on a diff in the pull request:
https://github.com/apache/spark/pull/18334#discussion_r124456568
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala ---
@@ -448,6 +433,145 @@ class StatisticsSuite extends
StatisticsCollectionTestBase with TestHiveSingleto
"ALTER TABLE unset_prop_table UNSET TBLPROPERTIES ('prop1')")
}
+ /**
+ * To see if stats exist, we need to check spark's stats properties
instead of catalog
+ * statistics, because hive would change stats in metastore and thus
change catalog statistics.
--- End diff --
Hive updates stats for some formats, e.g. in the test `test statistics of
LogicalRelation converted from Hive serde tables`, hive updates stats for orc
table but not parquet table.
I think it's tricky and fussy to relay on hive's stats, we should rely on
spark's stats. Here I just eliminate hive's influence for checking. As in
`CatalogStatistics` we first fill in hive's stats and then override it using
spark's stats, we can't tell where the stats is from if we check
`CatalogStatistics`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]