diff options
author | Wenchen Fan <wenchen@databricks.com> | 2016-03-07 10:32:34 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2016-03-07 10:32:34 -0800 |
commit | 489641117651d11806d2773b7ded7c163d0260e5 (patch) | |
tree | b7ded994d41d46d07d6dde54a012faa21549704e /sql/core/src/main/scala/org/apache | |
parent | d7eac9d7951c19302ed41fe03eaa38394aeb9c1a (diff) | |
download | spark-489641117651d11806d2773b7ded7c163d0260e5.tar.gz spark-489641117651d11806d2773b7ded7c163d0260e5.tar.bz2 spark-489641117651d11806d2773b7ded7c163d0260e5.zip |
[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 <wenchen@databricks.com>
Closes #11532 from cloud-fan/generate.
Diffstat (limited to 'sql/core/src/main/scala/org/apache')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/Generate.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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) |