-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert list operator to function in sql_expr_to_logical_expr
#8506
Comments
This makes sense to me |
I think there is a little issue with the current design. The type coercion for string concat is done inside string_coercion, btw, it is incorrect.
If we need to avoid the calculation (mainly type coercion) here, we may need an if else branch to skip the schema building for the operators that will be rewritten afterward. For example, return empty schema inside pub struct BinaryExpr {
/// Left-hand side of the expression
pub left: Box<Expr>,
/// The comparison operator
pub op: Operator,
/// Right-hand side of the expression
pub right: Box<Expr>,
/// will be rewritten (maybe better name)
pub will_be_rewritten: bool
} We can then do different things like return empty schema while building logical plan based on the @alamb @viirya how do you think? Upd: I have tested that return empty schema for if expr.len() != schema.fields().len() {
return plan_err!("Projection has mismatch between number of expressions ({}) and number of fields in schema ({})", expr.len(), schema.fields().len());
} |
sql_expr_to_logical_expr
Like what we have done for
[] -> MakeArray
.It is possible to have the similar conversion for other List Operator in the early stage (Sql to LogicExpr).
StringConcat
to Function forarray_concat
,array_append
andarray_prepend
#8636StringConcat
to Function forarray_concat
,array_append
andarray_prepend
#8636StringConcat
to Function forarray_concat
,array_append
andarray_prepend
#8636TODO
Other: clean up list/array coercion in
datafusion/expr/src/type_coercion/binary.rs
Originally posted by @viirya in #8496 (comment)
The text was updated successfully, but these errors were encountered: