-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: #10020 make concat function support array concatenation #19240
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
Conversation
martin-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like AI-generated code.
- it has several compilation errors
- it uses structs removed long time ago (e.g. BuiltinScalarFunction)
- there are no tests
|
|
||
| // Check if any argument is an array type | ||
| fn has_array_args(args: &[ColumnarValue]) -> bool { | ||
| use arrow::datatypes::DataType::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use arrow::datatypes::DataType::*; |
| fn has_array_args(args: &[ColumnarValue]) -> bool { | ||
| use arrow::datatypes::DataType::*; | ||
| args.iter().any(|arg| match arg { | ||
| ColumnarValue::Array(arr) => matches!(arr.data_type(), List(_)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ColumnarValue::Array(arr) => matches!(arr.data_type(), List(_)), | |
| ColumnarValue::Array(arr) => matches!(arr.data_type(), DataType::List(_)), |
| use DataType::*; | ||
|
|
||
| // If any argument is an array, return the array type | ||
| if arg_types.iter().any(|t| matches!(t, List(_))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if is not really needed. The inner one does the same.
| use arrow::datatypes::DataType::*; | ||
| args.iter().any(|arg| match arg { | ||
| ColumnarValue::Array(arr) => matches!(arr.data_type(), List(_)), | ||
| ColumnarValue::Scalar(scalar) => matches!(scalar, ScalarValue::List(_, _)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| List(Arc<ListArray>), |
| vec![Utf8View, Utf8, LargeUtf8], | ||
| Volatility::Immutable, | ||
| signature: Signature::variadic_any(Volatility::Immutable) | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ), | |
| , |
| array_concat, | ||
| args, | ||
| ))) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
| } |
to close the impl block
| use datafusion_expr::expr::{ScalarFunction, ScalarFunctionExpr}; | ||
| use datafusion_expr::simplify::{ExprSimplifyResult, SimplifyInfo}; | ||
| use datafusion_expr::{ColumnarValue, Documentation, Expr, Volatility, lit}; | ||
| use datafusion_expr::{ColumnarValue, Documentation, Expr, Volatility, lit, BuiltinScalarFunction}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuiltinScalarFunction has been removed from DataFusion long time ago...
|
I am closing this PR since:
We welcome contributions from the community, but please ensure appropriate effort has been put into PRs to make it easier for us to review them. |
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?