You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#14094 was a bit problematic for users with custom UDFs in that it may cause breaks at runtime.
The #[deprecated()] apparently doesn't affect for people implementing this trait, only those who call it.
As such, if someone (like us) had implemented return_type_from_exprs and had return_type just panic, that'd compile fine, but at runtime rather than calling the return_type_from_exprs DF would call this new return_type_from_args with its default impl delegating to return_type which would then panic.
Luckily, we had tests that caught it, but I think in this case it would have been better to fully remove the return_type_from_exprs so that users who override it would get compile failures, rather than runtime ones. Compile errors are annoying, sure, but still always better than compiling and doing wrong thing. And might still be good to remove it.
The "correct" way would have been to have a default return_type_from_args delegate to return_type_from_exprs, but I'm not sure if that's possible?
A worse alternative would have been to write the chain as return_type_from_exprs -> return_type_from_args -> return_type, and keep calling return_type_from_exprs. Not sure if that would have been possible either, or if the switch from return_type_from_exprs to return_type_from_args was necessary, and even still this wouldn't have helped if at some point in future someone would depend on return_type_from_args.
The "correct" way would have been to have a default return_type_from_args delegate to return_type_from_exprs, but I'm not sure if that's possible?
That's what we should have done. Except that return_type_from_exprs requires the expressions return_type_from_args doesn't have the expressions
it would need to fabricate some fake expressions. This is doable, but still could break something/someone who depended on having access to factual non-literal input expressions in their return_type_from_exprs impl. (I don't see a sense in such implementation, just speculating.)
Describe the bug
#14094 was a bit problematic for users with custom UDFs in that it may cause breaks at runtime.
The #[deprecated()] apparently doesn't affect for people implementing this trait, only those who call it.
As such, if someone (like us) had implemented
return_type_from_exprs
and hadreturn_type
just panic, that'd compile fine, but at runtime rather than calling thereturn_type_from_exprs
DF would call this newreturn_type_from_args
with its default impl delegating toreturn_type
which would then panic.Luckily, we had tests that caught it, but I think in this case it would have been better to fully remove the
return_type_from_exprs
so that users who override it would get compile failures, rather than runtime ones. Compile errors are annoying, sure, but still always better than compiling and doing wrong thing. And might still be good to remove it.The "correct" way would have been to have a default
return_type_from_args
delegate toreturn_type_from_exprs
, but I'm not sure if that's possible?A worse alternative would have been to write the chain as
return_type_from_exprs
->return_type_from_args
->return_type
, and keep callingreturn_type_from_exprs
. Not sure if that would have been possible either, or if the switch fromreturn_type_from_exprs
toreturn_type_from_args
was necessary, and even still this wouldn't have helped if at some point in future someone would depend onreturn_type_from_args
.To Reproduce
No response
Expected behavior
No response
Additional context
As an aside, there are still couple places referring
return_type_from_exprs
as comments when they really mean the "from_args" variant: https://github.com/search?q=repo%3Aapache%2Fdatafusion+return_type_from_exprs+language%3ARust&type=code&l=RustThe text was updated successfully, but these errors were encountered: