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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]