Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18002#discussion_r117093783
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnStats.scala
 ---
    @@ -53,219 +53,297 @@ private[columnar] sealed trait ColumnStats extends 
Serializable {
       /**
        * Gathers statistics information from `row(ordinal)`.
        */
    -  def gatherStats(row: InternalRow, ordinal: Int): Unit = {
    -    if (row.isNullAt(ordinal)) {
    -      nullCount += 1
    -      // 4 bytes for null position
    -      sizeInBytes += 4
    -    }
    +  def gatherStats(row: InternalRow, ordinal: Int): Unit
    +
    +  /**
    +   * Gathers statistics information on `null`.
    +   */
    +  def gatherNullStats(): Unit = {
    +    nullCount += 1
    +    // 4 bytes for null position
    +    sizeInBytes += 4
         count += 1
       }
     
       /**
    -   * Column statistics represented as a single row, currently including 
closed lower bound, closed
    +   * Column statistics represented as an array, currently including closed 
lower bound, closed
        * upper bound and null count.
        */
    -  def collectedStatistics: GenericInternalRow
    +  def collectedStatistics: Array[Any]
     }
     
     /**
      * A no-op ColumnStats only used for testing purposes.
      */
    -private[columnar] class NoopColumnStats extends ColumnStats {
    -  override def gatherStats(row: InternalRow, ordinal: Int): Unit = 
super.gatherStats(row, ordinal)
    +private[columnar] final class NoopColumnStats extends ColumnStats {
    +  override def gatherStats(row: InternalRow, ordinal: Int): Unit = {
    +    if (!row.isNullAt(ordinal)) {
    +      count += 1
    +    } else {
    +      super.gatherNullStats
    --- End diff --
    
    Good catch. done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to