Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed May 19, 2019
1 parent 37ced27 commit ad57acf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -42,7 +42,7 @@ object CatalystTypeConverters {
// Since the map values can be mutable, we explicitly import scala.collection.Map at here.
import scala.collection.Map

private[sql] def isPrimitive(dataType: DataType): Boolean = {
private def isPrimitive(dataType: DataType): Boolean = {
dataType match {
case BooleanType => true
case ByteType => true
Expand Down
Expand Up @@ -1006,7 +1006,7 @@ case class ScalaUDF(
val (funcArgs, initArgs) = evals.zipWithIndex.zip(children.map(_.dataType)).map {
case ((eval, i), dt) =>
val argTerm = ctx.freshName("arg")
val initArg = if (CatalystTypeConverters.isPrimitive(dt)) {
val initArg = if (CodeGenerator.isPrimitiveType(dt)) {
val convertedTerm = ctx.freshName("conv")
s"""
|${CodeGenerator.boxedType(dt)} $convertedTerm = ${eval.value};
Expand All @@ -1023,7 +1023,7 @@ case class ScalaUDF(
val resultConverter = s"$convertersTerm[${children.length}]"
val boxedType = CodeGenerator.boxedType(dataType)

val funcInvokation = if (CatalystTypeConverters.isPrimitive(dataType)
val funcInvokation = if (CodeGenerator.isPrimitiveType(dataType)
// If the output is nullable, the returned value must be unwrapped from the Option
&& !nullable) {
s"$resultTerm = ($boxedType)$getFuncResult"
Expand Down

0 comments on commit ad57acf

Please sign in to comment.