Skip to content

Commit

Permalink
Merge master Refactoring changes
Browse files Browse the repository at this point in the history
  • Loading branch information
codeatri committed Aug 14, 2018
1 parent 7df3ac5 commit b73106d
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,19 +511,18 @@ examples = """
""",
since = "2.4.0")
case class TransformValues(
input: Expression,
argument: Expression,
function: Expression)
extends MapBasedSimpleHigherOrderFunction with CodegenFallback {

override def nullable: Boolean = input.nullable
override def nullable: Boolean = argument.nullable

override def dataType: DataType = {
val map = input.dataType.asInstanceOf[MapType]
val map = argument.dataType.asInstanceOf[MapType]
MapType(map.keyType, function.dataType, function.nullable)
}

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

override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction)
: TransformValues = {
Expand All @@ -536,8 +535,8 @@ case class TransformValues(
(keyVar, valueVar)
}

override def nullSafeEval(inputRow: InternalRow, value: Any): Any = {
val map = value.asInstanceOf[MapData]
override def nullSafeEval(inputRow: InternalRow, argumentValue: Any): Any = {
val map = argumentValue.asInstanceOf[MapData]
val f = functionForEval
val resultValues = new GenericArrayData(new Array[Any](map.numElements))
var i = 0
Expand Down

0 comments on commit b73106d

Please sign in to comment.