Github user kiszk commented on a diff in the pull request: https://github.com/apache/spark/pull/19811#discussion_r156966971 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala --- @@ -1205,14 +1203,14 @@ case class DecodeUsingSerializer[T](child: Expression, tag: ClassTag[T], kryo: B // try conf from env, otherwise create a new one val env = s"${classOf[SparkEnv].getName}.get()" val sparkConf = s"new ${classOf[SparkConf].getName}()" - val serializerInit = s""" - if ($env == null) { - $serializer = ($serializerInstanceClass) new $serializerClass($sparkConf).newInstance(); + val serializer = ctx.addMutableState(serializerInstanceClass, "serializerForDecode", + v => s""" + if ($env == null) { + $v = ($serializerInstanceClass) new $serializerClass($sparkConf).newInstance(); } else { - $serializer = ($serializerInstanceClass) new $serializerClass($env.conf()).newInstance(); + $v = ($serializerInstanceClass) new $serializerClass($env.conf()).newInstance(); } - """ - ctx.addMutableState(serializerInstanceClass, serializer, serializerInit) + """, forceInline = true) --- End diff -- ditto
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org