Repository: spark
Updated Branches:
  refs/heads/master 4659468f3 -> e566fe598


[SPARK-6397][SQL] Check the missingInput simply

Author: q00251598 <qiyad...@huawei.com>

Closes #5082 from watermen/sql-missingInput and squashes the following commits:

25766b9 [q00251598] Check the missingInput simply


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e566fe59
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e566fe59
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e566fe59

Branch: refs/heads/master
Commit: e566fe5982bac5d24e6be76e5d7d6270544a85e6
Parents: 4659468
Author: q00251598 <qiyad...@huawei.com>
Authored: Mon Mar 23 12:06:13 2015 +0800
Committer: Cheng Lian <l...@databricks.com>
Committed: Mon Mar 23 12:06:13 2015 +0800

----------------------------------------------------------------------
 .../org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala  | 5 ++---
 .../spark/sql/catalyst/plans/logical/basicOperators.scala       | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e566fe59/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
----------------------------------------------------------------------
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 4e8fc89..fb975ee 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")

http://git-wip-us.apache.org/repos/asf/spark/blob/e566fe59/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala
----------------------------------------------------------------------
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 384fe53..a94b2d2 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 {


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

Reply via email to