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

    https://github.com/apache/spark/pull/19774#discussion_r151737674
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala ---
    @@ -689,6 +689,11 @@ case class DescribeColumnCommand(
           buffer += Row("distinct_count", 
cs.map(_.distinctCount.toString).getOrElse("NULL"))
           buffer += Row("avg_col_len", 
cs.map(_.avgLen.toString).getOrElse("NULL"))
           buffer += Row("max_col_len", 
cs.map(_.maxLen.toString).getOrElse("NULL"))
    +      buffer ++= cs.flatMap(_.histogram.map { hist =>
    --- End diff --
    
    I'm pretty sure that for-comprehension would make the code read easier.
    
    ```scala
    for {
      c <- cs
      hist <- c.histogram
      ...
    } yield ...
    ```
    
    Let me know if you need help with that.


---

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

Reply via email to