From 489641117651d11806d2773b7ded7c163d0260e5 Mon Sep 17 00:00:00 2001 From: Wenchen Fan Date: Mon, 7 Mar 2016 10:32:34 -0800 Subject: [SPARK-13694][SQL] QueryPlan.expressions should always include all expressions ## What changes were proposed in this pull request? It's weird that expressions don't always have all the expressions in it. This PR marks `QueryPlan.expressions` final to forbid sub classes overriding it to exclude some expressions. Currently only `Generate` override it, we can use `producedAttributes` to fix the unresolved attribute problem for it. Note that this PR doesn't fix the problem in #11497 ## How was this patch tested? existing tests. Author: Wenchen Fan Closes #11532 from cloud-fan/generate. --- sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/core/src') diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala index 6bc4649d43..9938d2169f 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala @@ -58,7 +58,7 @@ case class Generate( private[sql] override lazy val metrics = Map( "numOutputRows" -> SQLMetrics.createLongMetric(sparkContext, "number of output rows")) - override def expressions: Seq[Expression] = generator :: Nil + override def producedAttributes: AttributeSet = AttributeSet(output) val boundGenerator = BindReferences.bindReference(generator, child.output) -- cgit v1.2.3