Apache DataFusion SQL Query Engine
chore: Update Error for Unnest Rewritter (#10263)
Alex Huang1c0ecf6047aa
diff --git a/datafusion/optimizer/src/analyzer/type_coercion.rs b/datafusion/optimizer/src/analyzer/type_coercion.rsindex f96a359f9d..240afbb554 100644--- a/datafusion/optimizer/src/analyzer/type_coercion.rs+++ b/datafusion/optimizer/src/analyzer/type_coercion.rs@@ -24,8 +24,8 @@ use arrow::datatypes::{DataType, IntervalUnit};use datafusion_common::config::ConfigOptions;use datafusion_common::tree_node::{Transformed, TreeNodeRewriter};use datafusion_common::{- exec_err, internal_err, plan_datafusion_err, plan_err, DFSchema, DFSchemaRef,- DataFusionError, Result, ScalarValue,+ exec_err, internal_err, not_impl_err, plan_datafusion_err, plan_err, DFSchema,+ DFSchemaRef, DataFusionError, Result, ScalarValue,};use datafusion_expr::expr::{self, AggregateFunctionDefinition, Between, BinaryExpr, Case, Exists, InList,@@ -125,7 +125,7 @@ impl TreeNodeRewriter for TypeCoercionRewriter {fn f_up(&mut self, expr: Expr) -> Result<Transformed<Expr>> {match expr {- Expr::Unnest(_) => internal_err!(+ Expr::Unnest(_) => not_impl_err!("Unnest should be rewritten to LogicalPlan::Unnest before type coercion"),Expr::ScalarSubquery(Subquery {diff --git a/datafusion/sqllogictest/test_files/unnest.slt b/datafusion/sqllogictest/test_files/unnest.sltindex 28f3369ca0..ca7e73cb87 100644--- a/datafusion/sqllogictest/test_files/unnest.slt+++ b/datafusion/sqllogictest/test_files/unnest.slt@@ -383,5 +383,8 @@ select unnest(array_remove(column1, 3)) - 1 as c1, column3 from unnest_table;5 311 NULL+query error DataFusion error: type_coercion\ncaused by\nThis feature is not implemented: Unnest should be rewritten to LogicalPlan::Unnest before type coercion+select sum(unnest(generate_series(1,10)));+statement okdrop table unnest_table;