From 78658efffb3fe0632a5aafe45997c2ab24791475 Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 31 Jan 2015 00:10:19 +0800 Subject: [PATCH] remove redundant field "childOutput" --- .../scala/org/apache/spark/sql/execution/Aggregate.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) mode change 100644 => 100755 sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala old mode 100644 new mode 100755 index be9f155253d77..ad44a01d0e164 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala @@ -56,10 +56,6 @@ case class Aggregate( } } - // HACK: Generators don't correctly preserve their output through serializations so we grab - // out child's output attributes statically here. - private[this] val childOutput = child.output - override def output = aggregateExpressions.map(_.toAttribute) /** @@ -81,7 +77,7 @@ case class Aggregate( case a: AggregateExpression => ComputedAggregate( a, - BindReferences.bindReference(a, childOutput), + BindReferences.bindReference(a, child.output), AttributeReference(s"aggResult:$a", a.dataType, a.nullable)()) } }.toArray @@ -150,7 +146,7 @@ case class Aggregate( } else { child.execute().mapPartitions { iter => val hashTable = new HashMap[Row, Array[AggregateFunction]] - val groupingProjection = new InterpretedMutableProjection(groupingExpressions, childOutput) + val groupingProjection = new InterpretedMutableProjection(groupingExpressions, child.output) var currentRow: Row = null while (iter.hasNext) {