diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate2/aggregates.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate2/aggregates.scala index b14fac2ae9a37..11f35e69ae46f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate2/aggregates.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate2/aggregates.scala @@ -110,7 +110,7 @@ abstract class AggregateFunction2 def bufferSchema: StructType /** Attributes of fields in bufferSchema. */ - def bufferAttributes: Seq[Attribute] + def bufferAttributes: Seq[AttributeReference] /** Clones bufferAttributes. */ def cloneBufferAttributes: Seq[Attribute] @@ -147,7 +147,7 @@ case class MyDoubleSum(child: Expression) extends AggregateFunction2 { override val bufferSchema: StructType = StructType(StructField("currentSum", DoubleType, true) :: Nil) - override val bufferAttributes: Seq[Attribute] = bufferSchema.toAttributes + override val bufferAttributes: Seq[AttributeReference] = bufferSchema.toAttributes override lazy val cloneBufferAttributes = bufferAttributes.map(_.newInstance()) @@ -205,8 +205,8 @@ abstract class AlgebraicAggregate extends AggregateFunction2 with Serializable { override lazy val cloneBufferAttributes = bufferAttributes.map(_.newInstance()) implicit class RichAttribute(a: AttributeReference) { - def left = a - def right = cloneBufferAttributes(bufferAttributes.indexOf(a)) + def left: AttributeReference = a + def right: AttributeReference = cloneBufferAttributes(bufferAttributes.indexOf(a)) } /** An AlgebraicAggregate's bufferSchema is derived from bufferAttributes. */ @@ -277,4 +277,4 @@ case class Average(child: Expression) extends AlgebraicAggregate { override def nullable: Boolean = true override def dataType: DataType = resultType override def children: Seq[Expression] = child :: Nil -} \ No newline at end of file +} diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala index 75bbef5b5f9ed..446679240911d 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala @@ -21,8 +21,6 @@ import java.beans.Introspector import java.util.Properties import java.util.concurrent.atomic.AtomicReference -import org.apache.spark.sql.execution.aggregate2.{CheckAggregateFunction, ConvertAggregateFunction} - import scala.collection.JavaConversions._ import scala.collection.immutable import scala.language.implicitConversions @@ -42,6 +40,7 @@ import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan} import org.apache.spark.sql.catalyst.rules.RuleExecutor import org.apache.spark.sql.catalyst.{InternalRow, ParserDialect, _} import org.apache.spark.sql.execution.{Filter, _} +import org.apache.spark.sql.execution.aggregate2.{CheckAggregateFunction, ConvertAggregateFunction} import org.apache.spark.sql.sources._ import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala index 138fa0515115a..4e7d2e0062761 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala @@ -21,8 +21,6 @@ import java.io.File import java.net.{URL, URLClassLoader} import java.sql.Timestamp -import org.apache.spark.sql.execution.aggregate2.{CheckAggregateFunction, ConvertAggregateFunction} - import scala.collection.JavaConversions._ import scala.collection.mutable.HashMap import scala.language.implicitConversions @@ -46,6 +44,7 @@ import org.apache.spark.sql.catalyst.ParserDialect import org.apache.spark.sql.catalyst.analysis._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.execution.{ExecutedCommand, ExtractPythonUDFs, SetCommand} +import org.apache.spark.sql.execution.aggregate2.{CheckAggregateFunction, ConvertAggregateFunction} import org.apache.spark.sql.hive.client._ import org.apache.spark.sql.hive.execution.{DescribeHiveTableCommand, HiveNativeCommand} import org.apache.spark.sql.sources.DataSourceStrategy