qiuliang988 commented on code in PR #36412:
URL: https://github.com/apache/spark/pull/36412#discussion_r872511128


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitions.scala:
##########
@@ -80,10 +80,15 @@ private[sql] class PruneHiveTablePartitions(session: 
SparkSession)
       val colStats = filteredStats.map(_.attributeStats.map { case (attr, 
colStat) =>
         (attr.name, colStat.toCatalogColumnStat(attr.name, attr.dataType))
       })
+      val rowCount = if 
(prunedPartitions.forall(_.stats.flatMap(_.rowCount).exists(_ > 0))) {

Review Comment:
   Hi, @cloud-fan , does ```_.stats.flatMap (_.rowCount).exists(_ >0)``` not 
guarantee that stats and rowCount are defined and rowCount>0 for all partitions?
   If stats is not defined,  ```_.stats.flatMap(xxx)``` is None and 
```_.stats.flatMap (_.rowCount).exists(_ > 0)``` is false.
   If a rowCount is not defined, ```_.stats.flatMap(_.rowCount)``` is None and 
```_.stats.flatMap(_.rowCount).exists(_ > 0)``` is false.
   



-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to