diff --git a/datafusion/core/src/physical_planner.rs b/datafusion/core/src/physical_planner.rs index 406196a59146..5349a9b65d69 100644 --- a/datafusion/core/src/physical_planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -216,29 +216,27 @@ fn create_physical_name(e: &Expr, is_first_expr: bool) -> Result { let expr = create_physical_name(expr, false)?; Ok(format!("{expr} IS NOT UNKNOWN")) } - Expr::GetIndexedField(GetIndexedField { expr: _, field }) => { - match field { - GetFieldAccess::NamedStructField { name: _ } => { - unreachable!( - "NamedStructField should have been rewritten in OperatorToFunction" + Expr::GetIndexedField(GetIndexedField { expr: _, field }) => match field { + GetFieldAccess::NamedStructField { name: _ } => { + internal_err!( + "NamedStructField is no longer supported. Should use the get_field function instead" ) - } - GetFieldAccess::ListIndex { key: _ } => { - unreachable!( - "ListIndex should have been rewritten in OperatorToFunction" + } + GetFieldAccess::ListIndex { key: _ } => { + internal_err!( + "ListIndex is no longer supported. Should use the get_field function instead" ) - } - GetFieldAccess::ListRange { - start: _, - stop: _, - stride: _, - } => { - unreachable!( - "ListRange should have been rewritten in OperatorToFunction" + } + GetFieldAccess::ListRange { + start: _, + stop: _, + stride: _, + } => { + internal_err!( + "ListRange is no longer supported. Should use the get_field function instead" ) - } - }; - } + } + }, Expr::ScalarFunction(fun) => fun.func.display_name(&fun.args), Expr::WindowFunction(WindowFunction { fun, diff --git a/datafusion/functions-array/src/rewrite.rs b/datafusion/functions-array/src/rewrite.rs index a7aba78c1dbe..d18f1f8a3cbb 100644 --- a/datafusion/functions-array/src/rewrite.rs +++ b/datafusion/functions-array/src/rewrite.rs @@ -33,7 +33,7 @@ pub(crate) struct ArrayFunctionRewriter {} impl FunctionRewrite for ArrayFunctionRewriter { fn name(&self) -> &str { - "FunctionRewrite" + "ArrayFunctionRewriter" } fn rewrite(