Skip to content

Commit f3886fa

Browse files
author
Davies Liu
committed
don't inline primitiveTerm for null literal
1 parent c8e7cd2 commit f3886fa

File tree

1 file changed

+1
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+1
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ case class Literal protected (value: Any, dataType: DataType) extends LeafExpres
9292
// change the isNull and primitive to consts, to inline them
9393
if (value == null) {
9494
ev.isNull = "true"
95-
ev.primitive = ctx.defaultValue(dataType)
96-
""
95+
s"final ${ctx.javaType(dataType)} ${ev.primitive} = ${ctx.defaultValue(dataType)};"
9796
} else {
9897
dataType match {
9998
case BooleanType =>

0 commit comments

Comments
 (0)