cloud-fan commented on a change in pull request #33286:
URL: https://github.com/apache/spark/pull/33286#discussion_r670961773



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Statistics.scala
##########
@@ -119,6 +120,18 @@ case class ColumnStat(
       maxLen = maxLen,
       histogram = histogram,
       version = version)
+
+  def updateCountStats(
+      oldNumRows: BigInt,
+      newNumRows: BigInt,
+      updatedColumnStatOpt: Option[ColumnStat] = None): ColumnStat = {
+    val updatedColumnStat = updatedColumnStatOpt.getOrElse(this)
+    val newDistinctCount = EstimationUtils.updateStat(oldNumRows, newNumRows,
+      distinctCount.get, updatedColumnStat.distinctCount.get)

Review comment:
       This looks a bit different from the previous code, which doesn't update 
if ndv is none
   
   
https://github.com/apache/spark/pull/33286/files#diff-44195511bd23aefa127db08fca79496fe99b2243c9262c5b3c62a6c8d37cff41L918




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

Reply via email to