alamb commented on code in PR #8884:
URL: https://github.com/apache/arrow-datafusion/pull/8884#discussion_r1456696661
##########
datafusion/sql/src/expr/value.rs:
##########
@@ -135,38 +135,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
elements: Vec<SQLExpr>,
schema: &DFSchema,
) -> Result<Expr> {
- let mut values = Vec::with_capacity(elements.len());
-
- for element in elements {
- let value = self.sql_expr_to_logical_expr(
- element,
- schema,
- &mut PlannerContext::new(),
- )?;
-
- match value {
- Expr::Literal(_)
- // Array literal
- | Expr::ScalarFunction(ScalarFunction {
- func_def:
-
ScalarFunctionDefinition::BuiltIn(BuiltinScalarFunction::MakeArray),
- ..
- })
- // Struct literal
- | Expr::ScalarFunction(ScalarFunction {
- func_def:
-
ScalarFunctionDefinition::BuiltIn(BuiltinScalarFunction::Struct),
- ..
- }) => {
- values.push(value);
- }
- _ => {
- return internal_err!(
- "Arrays with elements other than literal are not
supported: {value}"
- );
- }
- }
- }
+ let values = elements
Review Comment:
I love it -- less code and more functionality ❤️ !
--
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]