Skip to content
Prev Previous commit
Next Next commit
review comments
  • Loading branch information
codeatri committed Aug 15, 2018
commit fb885f4797e72d0c2cbfa23980199c71e0c5aaee
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be moved to SimpleHigherOrderFunction

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.
Let's have wrap-up prs for higher-order functions after the remaining 2 prs are merged.


@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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just in one line?

}

@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