wangyum commented on issue #24523: [SPARK-27631][SQL] Avoid repeating calculate table statistics URL: https://github.com/apache/spark/pull/24523#issuecomment-492857080 Another special case. The data source table's statistics should be nonEmpty once `ANALYZE` it when using `HiveExternalCatalog`. ```scala val tableName = "spark_27631" withTable(tableName) { sql(s"CREATE TABLE $tableName(c1 INT) USING PARQUET") sql(s"INSERT INTO $tableName VALUES(1)") assert(DDLUtils.isDatasourceTable(getCatalogTable(tableName))) assert(getCatalogTable(tableName).stats.isEmpty) sql(s"ANALYZE TABLE $tableName COMPUTE STATISTICS") assert(getCatalogTable(tableName).stats.nonEmpty) sql(s"INSERT INTO $tableName VALUES(1)") // assert(getCatalogTable(tableName).stats.nonEmpty) // For HiveExternalCatalog // assert(getCatalogTable(tableName).stats.isEmpty) // For InMemoryCatalog } ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
