Skip to content

Commit

Permalink
rename to HigherOrderFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed Aug 7, 2018
1 parent 16d8b64 commit af79644
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ trait HigherOrderFunction extends Expression {
}
}

object HigherOrderFunctionHelper {
object HigherOrderFunction {

def arrayArgumentType(dt: DataType): (DataType, Boolean) = {
dt match {
Expand Down Expand Up @@ -218,7 +218,7 @@ case class ArrayTransform(
override def dataType: ArrayType = ArrayType(function.dataType, function.nullable)

override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): ArrayTransform = {
val elem = HigherOrderFunctionHelper.arrayArgumentType(input.dataType)
val elem = HigherOrderFunction.arrayArgumentType(input.dataType)
function match {
case LambdaFunction(_, arguments, _) if arguments.size == 2 =>
copy(function = f(function, elem :: (IntegerType, false) :: Nil))
Expand Down Expand Up @@ -278,7 +278,7 @@ case class MapFilter(
}

@transient val (keyType, valueType, valueContainsNull) =
HigherOrderFunctionHelper.mapKeyValueArgumentType(input.dataType)
HigherOrderFunction.mapKeyValueArgumentType(input.dataType)

override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): MapFilter = {
copy(function = f(function, (keyType, false) :: (valueType, valueContainsNull) :: Nil))
Expand Down Expand Up @@ -332,7 +332,7 @@ case class ArrayFilter(
override def expectingFunctionType: AbstractDataType = BooleanType

override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): ArrayFilter = {
val elem = HigherOrderFunctionHelper.arrayArgumentType(input.dataType)
val elem = HigherOrderFunction.arrayArgumentType(input.dataType)
copy(function = f(function, elem :: Nil))
}

Expand Down Expand Up @@ -411,7 +411,7 @@ case class ArrayAggregate(
override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): ArrayAggregate = {
// Be very conservative with nullable. We cannot be sure that the accumulator does not
// evaluate to null. So we always set nullable to true here.
val elem = HigherOrderFunctionHelper.arrayArgumentType(input.dataType)
val elem = HigherOrderFunction.arrayArgumentType(input.dataType)
val acc = zero.dataType -> true
val newMerge = f(merge, acc :: elem :: Nil)
val newFinish = f(finish, acc :: Nil)
Expand Down

0 comments on commit af79644

Please sign in to comment.