Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datafusion/expr/src/expr_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl ExprSchemable for Expr {
// verify that function is invoked with correct number and type of arguments as defined in `TypeSignature`
data_types_with_scalar_udf(&arg_data_types, func).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
func.name(),
Expand All @@ -164,7 +164,7 @@ impl ExprSchemable for Expr {
WindowFunctionDefinition::AggregateUDF(udf) => {
let new_types = data_types_with_aggregate_udf(&data_types, udf).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
fun.name(),
Expand Down Expand Up @@ -192,7 +192,7 @@ impl ExprSchemable for Expr {
AggregateFunctionDefinition::UDF(fun) => {
let new_types = data_types_with_aggregate_udf(&data_types, fun).map_err(|err| {
plan_datafusion_err!(
"{} and {}",
"{} {}",
err,
utils::generate_signature_error_msg(
fun.name(),
Expand Down
14 changes: 3 additions & 11 deletions datafusion/expr/src/type_coercion/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ pub fn data_types_with_scalar_udf(
if signature.type_signature.supports_zero_argument() {
return Ok(vec![]);
} else {
return plan_err!(
"[data_types_with_scalar_udf] signature {:?} does not support zero arguments.",
&signature.type_signature
);
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand All @@ -79,11 +76,7 @@ pub fn data_types_with_aggregate_udf(
if signature.type_signature.supports_zero_argument() {
return Ok(vec![]);
} else {
return plan_err!(
"[data_types_with_aggregate_udf] Coercion from {:?} to the signature {:?} failed.",
current_types,
&signature.type_signature
);
return plan_err!("{} does not support zero arguments.", func.name());
}
}

Expand Down Expand Up @@ -118,8 +111,7 @@ pub fn data_types(
return Ok(vec![]);
} else {
return plan_err!(
"[data_types] Coercion from {:?} to the signature {:?} failed.",
current_types,
"signature {:?} does not support zero arguments.",
&signature.type_signature
);
}
Expand Down
4 changes: 2 additions & 2 deletions datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ from arrays_values_without_nulls;
## array_element (aliases: array_extract, list_extract, list_element)

# Testing with empty arguments should result in an error
query error DataFusion error: Error during planning: Error during planning: \[data_types_with_scalar_udf\] signature ArraySignature\(ArrayAndIndex\) does not support zero arguments.
query error DataFusion error: Error during planning: Error during planning: array_element does not support zero arguments.
select array_element();

# array_element error
Expand Down Expand Up @@ -1979,7 +1979,7 @@ select array_slice(a, -1, 2, 1), array_slice(a, -1, 2),
[6.0] [6.0] [] []

# Testing with empty arguments should result in an error
query error DataFusion error: Error during planning: Error during planning: \[data_types_with_scalar_udf\] signature VariadicAny does not support zero arguments.
query error DataFusion error: Error during planning: Error during planning: array_slice does not support zero arguments.
select array_slice();


Expand Down