Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codeatri committed Aug 15, 2018
1 parent e5d9b05 commit fb885f4
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,22 +518,19 @@ case class TransformKeys(

override def nullable: Boolean = argument.nullable

@transient lazy val MapType(keyType, valueType, valueContainsNull) = argument.dataType

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

@transient lazy val MapType(keyType, valueType, valueContainsNull) = argument.dataType

override def bind(f: (Expression, Seq[(DataType, Boolean)]) => LambdaFunction): TransformKeys = {
copy(function = f(function, (keyType, false) :: (valueType, valueContainsNull) :: Nil))
}

@transient lazy val (keyVar, valueVar) = {
@transient lazy val LambdaFunction(
_, (keyVar: NamedLambdaVariable) :: (valueVar: NamedLambdaVariable) :: Nil, _) = function
(keyVar, valueVar)
}
@transient lazy val LambdaFunction(
_, (keyVar: NamedLambdaVariable) :: (valueVar: NamedLambdaVariable) :: Nil, _) = function


override def nullSafeEval(inputRow: InternalRow, argumentValue: Any): Any = {
val map = argumentValue.asInstanceOf[MapData]
Expand Down

0 comments on commit fb885f4

Please sign in to comment.