Skip to content

Commit

Permalink
[bugfix] propagate the nullable flag for serialized scalar UDFS
Browse files Browse the repository at this point in the history
  • Loading branch information
ccciudatu committed Dec 18, 2024
1 parent e4d17cb commit 071d0b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions datafusion/proto/src/physical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,15 @@ pub fn parse_physical_expr(

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

Arc::new(ScalarFunctionExpr::new(
e.name.as_str(),
scalar_fun_def,
args,
convert_required!(e.return_type)?,
))
Arc::new(
ScalarFunctionExpr::new(
e.name.as_str(),
scalar_fun_def,
args,
convert_required!(e.return_type)?,
)
.with_nullable(e.nullable),
)
}
ExprType::LikeExpr(like_expr) => Arc::new(LikeExpr::new(
like_expr.negated,
Expand Down
1 change: 1 addition & 0 deletions datafusion/proto/src/physical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ pub fn serialize_physical_expr(
args: serialize_physical_exprs(expr.args(), codec)?,
fun_definition: (!buf.is_empty()).then_some(buf),
return_type: Some(expr.return_type().try_into()?),
nullable: expr.nullable(),
},
)),
})
Expand Down

0 comments on commit 071d0b1

Please sign in to comment.