-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Require all zero argument UDFs use Signature::Nullary
, improve error messages
#13871
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Signature::Any(0)
, and add tests for zero argumentsSignature::Any(0)
, and add tests for zero argument udfs
6def9f3
to
2f83cd0
Compare
…rgument functions - Updated the `Simple0ArgsScalarUDF` to utilize `Signature::nullary` instead of `Signature::exact`. - Modified tests to reflect the change in signature handling for zero-argument functions. - Enhanced error messages in type coercion functions to clarify the requirement for nullary signatures. - Cleaned up redundant checks and improved code readability in the type coercion logic. This change improves consistency in how zero-argument functions are defined and validated across the codebase.
Signed-off-by: Jay Zhan <jayzhan211@gmail.com>
I update the fix here alamb#22 |
Require all zero argument UDFs use `Signature::Nullary`, improve error messages
Signature::Any(0)
, and add tests for zero argument udfsSignature::Nullary
, improve error messages
Given there are a few more built in functions with exact, I think we should postpone this PR until next release (aka postpone merge for a few days) In the intervening time I will prepare a PR that just improves the error message for 43. Thank you for your help @jayzhan211 |
Here is a PR with just improvements to the error messages |
I don't have time to finish this work now. If anyone else wants to try and make progress, feel free |
Which issue does this PR close?
Signature::nullary
in 44.0.0 easier / less confusing #13763Rationale for this change
As described on #13763
In version s 43.0.0 and earlier of DataFusion, a
TypeSignature::Any(0)
means your udf could be called with zero arguments:SELECT my_udf();
However in version 44.0.0 you get a very confusing error that says zero arguments are not supported but then gives you a candidate function is the one it just said was not supported:
Also,
Signature::Exact(vec![])
does work.What changes are included in this PR?
Are these changes tested?
Yes, now integration tests are added, and redundant unit tests removed
Are there any user-facing changes?