yeshengm commented on a change in pull request #24915: [SPARK-28096][SQL] 
Convert defs to lazy vals to avoid expensive `output` computation in QueryPlans
URL: https://github.com/apache/spark/pull/24915#discussion_r295902912
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
 ##########
 @@ -934,7 +952,8 @@ object Limit {
  * See [[Limit]] for more information.
  */
 case class GlobalLimit(limitExpr: Expression, child: LogicalPlan) extends 
OrderPreservingUnaryNode {
-  override def output: Seq[Attribute] = child.output
+  @transient
+  override lazy val output: Seq[Attribute] = child.output
 
 Review comment:
   Do you mean all the simple cases like this one?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to