puneetdixit200 commented on code in PR #22285:
URL: https://github.com/apache/datafusion/pull/22285#discussion_r3278269669
##########
datafusion/functions-nested/src/arrays_zip.rs:
##########
@@ -327,3 +331,183 @@ fn arrays_zip_inner(args: &[ArrayRef]) ->
Result<ArrayRef> {
Ok(Arc::new(result))
}
+
+/// Fast path for regular List inputs whose existing buffers already match the
+/// zipped output: all offsets and values lengths match, and null rows cover no
+/// values. This lets us reuse offsets and child values instead of rebuilding.
+fn try_perfect_list_zip(args: &[ArrayRef]) -> Result<Option<ArrayRef>> {
+ let mut list_arrays = Vec::with_capacity(args.len());
+ let mut struct_fields = Vec::with_capacity(args.len());
+
+ for (i, arg) in args.iter().enumerate() {
+ let arr = match arg.data_type() {
+ List(field) => {
+ struct_fields.push(Field::new(
+ (i + 1).to_string(),
Review Comment:
Passed the generated field names into `try_perfect_list_zip` in `035689147`,
and added a unit test that verifies the fast path uses caller-supplied field
names.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]