Skip to content

Conversation

@jeffreyssmith2nd
Copy link
Contributor

Which issue does this PR close?

Closes #10915.

Rationale for this change

The changes in #10651 lead to a change in the error messages given when a function is called without any arguments. I think it can be made a little clearer to the user what actually went wrong, the error message as of this PR vs main can be seen below.

The new error message as of this PR:

"Error during planning: Error during planning: SUM does not support zero arguments. No function matches the given name and argument types 'SUM()'. You might need to add explicit type casts.\n\tCandidate functions:\n\tSUM(UserDefine
d)"

The current error message in main:

"Error during planning: Error during planning: [data_types_with_aggregate_udf] Coercion from [] to the signature VariadicAny failed. and No function matches the given name and argument types 'selector_last()'. You might need to add explicit type casts.\n\tCandidate functions:\n\tselector_last(Any, .., Any)"

What changes are included in this PR?

A few error messages are updated to provide users with a bit more context.

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jun 14, 2024
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jun 14, 2024
@jeffreyssmith2nd jeffreyssmith2nd marked this pull request as ready for review June 14, 2024 16:10
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement to me. Thank you @jeffreyssmith2nd

cc @jayzhan211

@jayzhan211
Copy link
Contributor

Thanks @jeffreyssmith2nd and @alamb

@jayzhan211 jayzhan211 merged commit ebca681 into apache:main Jun 15, 2024
@alamb alamb deleted the smith/update-error-messages branch June 15, 2024 15:59
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* chore: update some error messages for clarity

* chore: update error messages in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear error message when calling a function with no parameters.

3 participants