kosiew commented on code in PR #26192:
URL: https://github.com/apache/datafusion/pull/26192#discussion_r4247445513
##########
datafusion/functions-nested/src/extract.rs:
##########
@@ -618,7 +619,9 @@ where
// We have the slice syntax compatible with DuckDB v0.8.1.
// The rule `adjusted_from_index` and `adjusted_to_index` follows the rule
of array_slice in duckdb.
- let mut offsets = vec![O::usize_as(0)];
+ let mut offsets = Vec::with_capacity(array.len() + 1);
+ offsets.push(O::usize_as(0));
+ let mut indices = Vec::new();
Review Comment:
Could we add a test that mixes indexed slicing, contiguous slicing, empty
and null rows, and negative strides within the same batch, for both List and
ListView? This would help verify that reusing the indices buffer works
correctly when switching between slicing modes, even though I haven't found a
correctness issue.
--
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]