Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21352#discussion_r202580479
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -1324,15 +1329,15 @@ case class Concat(children: Seq[Expression]) 
extends Expression {
       since = "2.4.0")
     case class Flatten(child: Expression) extends UnaryExpression {
     
    -  private val MAX_ARRAY_LENGTH = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH
    -
    +  @transient
       private lazy val childDataType: ArrayType = 
child.dataType.asInstanceOf[ArrayType]
    --- End diff --
    
    we should only use `lazy val` if it can save some heavy computation. For 
things like this, I think `def` is good enough


---

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

Reply via email to