Skip to content

Commit ef352a2

Browse files
committed
[bugfix] propagate the nullable flag for serialized scalar UDFS
1 parent 93085d0 commit ef352a2

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

datafusion/proto/src/physical_plan/from_proto.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,15 @@ pub fn parse_physical_expr(
359359

360360
let args = parse_physical_exprs(&e.args, registry, input_schema, codec)?;
361361

362-
Arc::new(ScalarFunctionExpr::new(
363-
e.name.as_str(),
364-
scalar_fun_def,
365-
args,
366-
convert_required!(e.return_type)?,
367-
))
362+
Arc::new(
363+
ScalarFunctionExpr::new(
364+
e.name.as_str(),
365+
scalar_fun_def,
366+
args,
367+
convert_required!(e.return_type)?,
368+
)
369+
.with_nullable(e.nullable),
370+
)
368371
}
369372
ExprType::LikeExpr(like_expr) => Arc::new(LikeExpr::new(
370373
like_expr.negated,

datafusion/proto/src/physical_plan/to_proto.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ pub fn serialize_physical_expr(
348348
args: serialize_physical_exprs(expr.args(), codec)?,
349349
fun_definition: (!buf.is_empty()).then_some(buf),
350350
return_type: Some(expr.return_type().try_into()?),
351+
nullable: expr.nullable(),
351352
},
352353
)),
353354
})

0 commit comments

Comments
 (0)