apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.89k stars 1.11k forks source link

Serialization of UDF might lose aliases #11595

Closed edmondop closed 1 week ago

edmondop commented 1 month ago

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

https://github.com/apache/datafusion/blob/ecf5323eaa38869ed2f911b02f98e17aa6db639a/datafusion/proto/tests/cases/roundtrip_physical_plan.rs#L952-L964

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

Lordworms commented 1 month ago

take

edmondop commented 3 weeks ago

take