-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require all zero argument UDFs use Signature::Nullary
, improve error messages
#13871
Draft
alamb
wants to merge
9
commits into
apache:main
Choose a base branch
from
alamb:alamb/signature_nullary
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alamb
commented
Dec 21, 2024
alamb
changed the title
Re-support
Re-support Dec 21, 2024
Signature::Any(0)
, and add tests for zero argumentsSignature::Any(0)
, and add tests for zero argument udfs
alamb
force-pushed
the
alamb/signature_nullary
branch
from
December 21, 2024 14:18
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 <[email protected]>
I update the fix here alamb#22 |
Require all zero argument UDFs use `Signature::Nullary`, improve error messages
alamb
changed the title
Re-support
Require all zero argument UDFs use Dec 22, 2024
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core
Core DataFusion crate
functions
logical-expr
Logical plan and expressions
optimizer
Optimizer rules
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?