Skip to content

Commit 2deeba8

Browse files
committed
fix test failures
1 parent ec6aa50 commit 2deeba8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

100755100644
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ case class BoundReference(ordinal: Int, dataType: DataType, nullable: Boolean)
6363
val value = ctx.getValue(ctx.INPUT_ROW, dataType, ordinal.toString)
6464
if (ctx.currentVars != null && ctx.currentVars(ordinal) != null) {
6565
val oev = ctx.currentVars(ordinal)
66-
ev.isNull = if (!nullable || ctx.INPUT_ROW == null) {
66+
ev.isNull = if (!nullable || oev.isNull != "false" || ctx.INPUT_ROW == null) {
6767
oev.isNull
6868
} else {
69-
s"((${oev.isNull}) || ${ctx.INPUT_ROW}.isNullAt($ordinal))"
69+
// generate nullcheck if inputvalue is non-null and its expression is nullable
70+
s"${ctx.INPUT_ROW}.isNullAt($ordinal)"
7071
}
7172
ev.value = oev.value
7273
val code = oev.code

0 commit comments

Comments
 (0)