diff options
author | q00251598 <qiyadong@huawei.com> | 2015-03-23 12:06:13 +0800 |
---|---|---|
committer | Cheng Lian <lian@databricks.com> | 2015-03-23 12:06:13 +0800 |
commit | e566fe5982bac5d24e6be76e5d7d6270544a85e6 (patch) | |
tree | dff9a1d7c77e9fb3feb736577e9e0151c676b259 /sql | |
parent | 4659468f369d69e7f777130e5e3b4c5d47a624f1 (diff) | |
download | spark-e566fe5982bac5d24e6be76e5d7d6270544a85e6.tar.gz spark-e566fe5982bac5d24e6be76e5d7d6270544a85e6.tar.bz2 spark-e566fe5982bac5d24e6be76e5d7d6270544a85e6.zip |
[SPARK-6397][SQL] Check the missingInput simply
Author: q00251598 <qiyadong@huawei.com>
Closes #5082 from watermen/sql-missingInput and squashes the following commits:
25766b9 [q00251598] Check the missingInput simply
Diffstat (limited to 'sql')
2 files changed, 4 insertions, 3 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala index 4e8fc892f3..fb975ee5e7 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala @@ -85,9 +85,8 @@ class CheckAnalysis { cleaned.foreach(checkValidAggregateExpression) - case o if o.children.nonEmpty && - !o.references.filter(_.name != "grouping__id").subsetOf(o.inputSet) => - val missingAttributes = (o.references -- o.inputSet).map(_.prettyString).mkString(",") + case o if o.children.nonEmpty && o.missingInput.nonEmpty => + val missingAttributes = o.missingInput.map(_.prettyString).mkString(",") val input = o.inputSet.map(_.prettyString).mkString(",") failAnalysis(s"resolved attributes $missingAttributes missing from $input") diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala index 384fe53a68..a94b2d2095 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala @@ -191,6 +191,8 @@ case class Expand( val sizeInBytes = child.statistics.sizeInBytes * projections.length Statistics(sizeInBytes = sizeInBytes) } + + override def missingInput = super.missingInput.filter(_.name != VirtualColumn.groupingIdName) } trait GroupingAnalytics extends UnaryNode { |