You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/15 23:10:37 UTC

[GitHub] [spark] wangyum commented on issue #24523: [SPARK-27631][SQL] Avoid repeating calculate table statistics

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org