This is an automated email from the ASF dual-hosted git repository.
comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 1c0ecf6047 chore: Update Error for Unnest Rewritter (#10263)
1c0ecf6047 is described below
commit 1c0ecf6047aa439d4bfeeb56f8c0e60e612f5a87
Author: Alex Huang <[email protected]>
AuthorDate: Mon Apr 29 23:51:24 2024 +0800
chore: Update Error for Unnest Rewritter (#10263)
* chore: Update Error for Unnest Rewritter
* chore: Update unnest.slt test
---
datafusion/optimizer/src/analyzer/type_coercion.rs | 6 +++---
datafusion/sqllogictest/test_files/unnest.slt | 3 +++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/datafusion/optimizer/src/analyzer/type_coercion.rs
b/datafusion/optimizer/src/analyzer/type_coercion.rs
index 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.slt
index 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 3
11 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 ok
drop table unnest_table;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]