jayzhan211 commented on code in PR #9069:
URL: https://github.com/apache/arrow-datafusion/pull/9069#discussion_r1473682907
##########
datafusion/sql/src/expr/function.rs:
##########
@@ -70,6 +70,50 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
return Ok(Expr::ScalarFunction(ScalarFunction::new_udf(fm, args)));
}
+ // Build Unnest expression
+ if name.eq("unnest") {
+ let exprs =
+ self.function_args_to_expr(args.clone(), schema,
planner_context)?;
+
+ match exprs.len() {
+ 0 => {
+ return exec_err!("unnest() requires at least one
argument");
+ }
+ 1 => {
+ if let Expr::ScalarFunction(ScalarFunction {
+ func_def:
+ ScalarFunctionDefinition::BuiltIn(
+ BuiltinScalarFunction::MakeArray,
+ ),
+ ..
+ }) = exprs[0]
+ {
+ // valid
+ } else if let Expr::Column(_) = exprs[0] {
Review Comment:
arguments handling in Column seems not possible to handle anywhere before
transforming to LogicalPlan. We should validate arguments inside UnnestExec or
elsewhere downstream.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]