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
{{ message }}
Repository navigation
Type signature matching errors are overly verbose and show internal details #20501
After upgrading to DataFusion 52, error messages for function signature mismatches have become less concise and helpful. When a user tries to call an aggregate function with an unsupported type, they now see verbose internal errors instead of user-friendly messages.
This regression was introduced in PR #18769 ("Refactor avg & sum signatures away from user defined"), which was part of the broader effort in #12725 to avoid use of Signature::user_defined.
To Reproduce
CREATETABLEtest (bool_col BOOLEAN);
SELECTSUM(bool_col) FROM test;
Before (DataFusion 51):
Error during planning: Execution error: Function 'sum' user-defined coercion failed with "Execution error: Sum not supported for Boolean" No function matches the given name and argument types 'sum(Boolean)'. You might need to add explicit type casts.
Candidate functions:
sum(UserDefined)
The key message "Sum not supported for Boolean" was clear and actionable.
After (DataFusion 52):
Error during planning: Internal error: Function 'sum' failed to match any signature, errors: Internal error: Expect TypeSignatureClass::Decimal but received NativeType::Boolean, DataType: Boolean.
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(UInt64), UInt64)) but received NativeType::Boolean, DataType: Boolean.
This issue was likely caused by a bug in DataFusion's code...
[repeats for each signature variant]
Candidate functions:
sum(Coercion(TypeSignatureClass::Decimal))
sum(Coercion(TypeSignatureClass::Native(LogicalType(Native(UInt64), UInt64)), implicit_coercion=...))
...
Problems With New Error
Misleading: Says "Internal error" and asks users to file a bug report, but this is a user error (wrong argument type), not a DataFusion bug
Verbose: Shows every failed signature match attempt with internal type system details (TypeSignatureClass::Native(LogicalType(...)))
Lost context: The meaningful message "Sum not supported for Boolean" is no longer present
The immediate problem seems to be that TypeSignature::OneOf turns overload/coercion failures into an Internal error, which then becomes user-visible during planning.
Would it make sense to return a normal planning error here instead, while keeping the existing candidate-signature diagnostics?
That would not fully restore the older Sum not supported for Boolean wording, but it should address the misleading internal-error behavior and the exposed internal type details.
Would it also make sense to look at this implementation? #21032
Activity
alamb commentedon Feb 23, 2026
I think this might be related to some changes @Jefffrey might remember 🤔
Jefffrey commentedon Mar 2, 2026
Yeah #20070 (and the linked issues inside it) is meant to work towards solving this (along with #20605 it seems)
myandpr commentedon Mar 18, 2026
Hi @Jefffrey @alamb I spent a bit of time looking at this.
The immediate problem seems to be that
TypeSignature::OneOfturns overload/coercion failures into anInternal error, which then becomes user-visible during planning.Would it make sense to return a normal planning error here instead, while keeping the existing candidate-signature diagnostics?
That would not fully restore the older
Sum not supported for Booleanwording, but it should address the misleading internal-error behavior and the exposed internal type details.Would it also make sense to look at this implementation? #21032
fix: report OneOf signature mismatches as planning errors (apache#26329)