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


With regards,
Apache Git Services

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

Reply via email to