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

    https://github.com/apache/spark/pull/20935#discussion_r178444014
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnStats.scala
 ---
    @@ -322,19 +323,75 @@ private[columnar] final class 
DecimalColumnStats(precision: Int, scale: Int) ext
         Array[Any](lower, upper, nullCount, count, sizeInBytes)
     }
     
    -private[columnar] final class ObjectColumnStats(dataType: DataType) 
extends ColumnStats {
    -  val columnType = ColumnType(dataType)
    +private abstract class OrderableSafeColumnStats[T](dataType: DataType) 
extends ColumnStats {
    +  protected var upper: T = _
    +  protected var lower: T = _
    +
    +  private val columnType = ColumnType(dataType)
    +  private val ordering = dataType match {
    +    case x if RowOrdering.isOrderable(dataType) =>
    +      Option(TypeUtils.getInterpretedOrdering(x))
    +    case _ => None
    --- End diff --
    
    Since this class is only for "orderable", maybe we don't need optional here 
and `ordering` can just be `Ordering[T]`.


---

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

Reply via email to