Skip to content

Commit

Permalink
Format update.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhuai committed Jul 17, 2015
1 parent 70b169c commit 6edb5ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6edb5ac

Please sign in to comment.