Skip to content

Serialization of UDF might lose aliases #11595

@edmondop

Description

@edmondop

Describe the bug

As a part of migrating min/max to user-defined aggregate function, the test `'cases::roundtrip_physical_plan::roundtrip_scalar_udf_extension_codec' (datafusion/proto/tests/cases/roundtrip_physical_plan.rs) fails

Arc::new(Max::new(udf_expr.clone(), "max", DataType::Int64)),
&[col("author", &schema)?],
&[],
Arc::new(WindowFrame::new(None)),
))],
filter,
vec![col("author", &schema)?],
)?);
let aggregate = Arc::new(AggregateExec::try_new(
AggregateMode::Final,
PhysicalGroupBy::new(vec![], vec![], vec![]),
vec![Arc::new(Max::new(udf_expr, "max", DataType::Int64))],

After investigating the failure (see https://github.com/apache/datafusion/actions/runs/10040552648/job/27746844799?pr=11013#step:4:5769) it appears that the signature, the aliases and the name are lost in serialization/deserialization
Screenshot 2024-07-22 at 8 37 51 AM

This doesn't appear to be a problem related to migrating min/max to user-defined functions but rather a general problem we only encounter because that's the only roundtrip serialization/deserialization tests that involve UDF

To Reproduce

No response

Expected behavior

Roundtrip should work correctly and restore aliases, as well as correct names and signature

Additional context

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions