comphead commented on code in PR #8142:
URL: https://github.com/apache/arrow-datafusion/pull/8142#discussion_r1392905922
##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -563,13 +563,42 @@ pub fn array_slice(args: &[ArrayRef]) -> Result<ArrayRef>
{
define_array_slice(list_array, key, extra_key, false)
}
+fn general_array_pop(
+ list_array: &GenericListArray<i32>,
+ from_back: bool,
+) -> Result<(Vec<i64>, Vec<i64>)> {
+ if from_back {
+ let key = vec![0; list_array.len()];
+ let extra_key: Vec<_> = list_array
+ .iter()
+ .map(|x| x.map_or(0, |arr| arr.len() as i64 - 1))
+ .collect();
+ Ok((key, extra_key))
+ } else {
+ let key: Vec<_> = list_array.iter().map(|x| x.map_or(0, |_arr|
2)).collect();
Review Comment:
thanks, please leave the comment in the code what the 2 is, so for other
devs it will be easier to read the code.
--
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]