comphead commented on code in PR #8142:
URL: https://github.com/apache/arrow-datafusion/pull/8142#discussion_r1392906610


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -564,13 +564,30 @@ 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:
   ```suggestion
           let key: Vec<_> = list_array.iter().map(|x| x.map_or(0, |_| 
2)).collect();
   ```



-- 
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]

Reply via email to