Skip to content
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

Introduce user-defined signature #10439

Merged
merged 16 commits into from
May 11, 2024
Prev Previous commit
Next Next commit
fix ci
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
jayzhan211 committed May 11, 2024
commit 5cb0d0f3eb9561aec71add75d595022aa2f1b1e2
4 changes: 1 addition & 3 deletions datafusion/optimizer/src/analyzer/type_coercion.rs
Original file line number Diff line number Diff line change
@@ -865,11 +865,9 @@ mod test {
signature: Signature::uniform(1, vec![DataType::Float32], Volatility::Stable),
})
.call(vec![lit("Apple")]);
let plan_err = Projection::try_new(vec![udf], empty)
Projection::try_new(vec![udf], empty)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think matching err message is unnecessary

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as the message is tested elsewhere I think this is fine

.expect_err("Expected an error due to incorrect function input");

// check only prefix since the error message includes backtrace
assert!(plan_err.to_string().starts_with("Error during planning: Error during planning: [data_types_with_scalar_udf] Coercion from [Utf8] to the signature Uniform(1, [Float32]) failed. and No function matches the given name and argument types 'TestScalarUDF(Utf8)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tTestScalarUDF(Float32)"));
Ok(())
}