From 56a46851b3dc1397e91491f08d93211fbbc99fc5 Mon Sep 17 00:00:00 2001 From: comphead Date: Tue, 1 Aug 2023 15:02:56 -0700 Subject: [PATCH] comments --- datafusion/common/src/error.rs | 2 +- datafusion/expr/src/type_coercion/aggregates.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datafusion/common/src/error.rs b/datafusion/common/src/error.rs index aee40fc7971e..240194d86819 100644 --- a/datafusion/common/src/error.rs +++ b/datafusion/common/src/error.rs @@ -446,7 +446,7 @@ macro_rules! make_error { }; } -// DataFusionError::Plan +// Exposes a macro to create `DataFusionError::Plan` make_error!(plan_err, Plan); #[cfg(test)] diff --git a/datafusion/expr/src/type_coercion/aggregates.rs b/datafusion/expr/src/type_coercion/aggregates.rs index fb93cb07cd09..f057aaba97c7 100644 --- a/datafusion/expr/src/type_coercion/aggregates.rs +++ b/datafusion/expr/src/type_coercion/aggregates.rs @@ -184,7 +184,7 @@ pub fn coerce_types( } AggregateFunction::Correlation => { if !is_correlation_support_arg_type(&input_types[0]) { - return Err(DataFusionError::Plan(format!( + return plan_err!( "The function {:?} does not support inputs of type {:?}.", agg_fun, input_types[0] @@ -197,7 +197,7 @@ pub fn coerce_types( let input_types_valid = // number of input already checked before valid_types.contains(&input_types[0]) && valid_types.contains(&input_types[1]); if !input_types_valid { - return Err(DataFusionError::Plan(format!( + return plan_err!( "The function {:?} does not support inputs of type {:?}.", agg_fun, input_types[0]