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

    https://github.com/apache/spark/pull/16594#discussion_r102138379
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Statistics.scala
 ---
    @@ -54,11 +57,29 @@ case class Statistics(
     
       /** Readable string representation for the Statistics. */
       def simpleString: String = {
    -    Seq(s"sizeInBytes=$sizeInBytes",
    -      if (rowCount.isDefined) s"rowCount=${rowCount.get}" else "",
    +    Seq(s"sizeInBytes=${format(sizeInBytes, isSize = true)}",
    +      if (rowCount.isDefined) s"rowCount=${format(rowCount.get, isSize = 
false)}" else "",
           s"isBroadcastable=$isBroadcastable"
         ).filter(_.nonEmpty).mkString(", ")
       }
    +
    +  /** Show the given number in a readable format. */
    +  def format(number: BigInt, isSize: Boolean): String = {
    +    val decimalValue = BigDecimal(number, new MathContext(3, 
RoundingMode.HALF_UP))
    +    if (isSize) {
    +      // The largest unit in Utils.bytesToString is TB
    --- End diff --
    
    How about improving `bytesToString` and make it support PB or higher? 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to