From b245ad61528090ccad1f30a8932a93f5ebd1349a Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 13 Dec 2023 13:58:18 -0800 Subject: [PATCH] Improve error message --- datafusion/expr/src/expr.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs index 76b258a8a9e9..f0aab95b8f0d 100644 --- a/datafusion/expr/src/expr.rs +++ b/datafusion/expr/src/expr.rs @@ -384,8 +384,10 @@ impl ScalarFunctionDefinition { ScalarFunctionDefinition::UDF(udf) => { Ok(udf.signature().volatility == crate::Volatility::Volatile) } - ScalarFunctionDefinition::Name(_) => { - internal_err!("Cannot determine volatility of unresolved function") + ScalarFunctionDefinition::Name(func) => { + internal_err!( + "Cannot determine volatility of unresolved function: {func}" + ) } } } @@ -1869,6 +1871,6 @@ mod test { // Unresolved function ScalarFunctionDefinition::Name(Arc::from("UnresolvedFunc")) .is_volatile() - .expect_err("Unresolved function should not be resolved"); + .expect_err("Shouldn't determine volatility of unresolved function"); } }