izveigor commented on code in PR #6986:
URL: https://github.com/apache/arrow-datafusion/pull/6986#discussion_r1265144992


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -543,7 +545,18 @@ fn align_array_dimensions(args: Vec<ArrayRef>) -> 
Result<Vec<ArrayRef>> {
                 let mut aligned_array = array.clone();
                 for _ in 0..(max_ndim - ndim) {
                     let data_type = aligned_array.as_ref().data_type().clone();
-                    aligned_array = array_array(&[aligned_array], data_type)?;
+                    let offsets: Vec<i32> =
+                        (0..downcast_arg!(aligned_array, 
ListArray).offsets().len())
+                            .map(|i| i as i32)
+                            .collect();
+                    let field = Arc::new(Field::new("item", data_type, true));
+
+                    aligned_array = Arc::new(ListArray::try_new(

Review Comment:
   Is there a method how to push `NULL`s into `ListArray::try_new` with saving 
values? 🤔
   @tustvold, can you give me some advice if you have free time.



##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -543,7 +545,18 @@ fn align_array_dimensions(args: Vec<ArrayRef>) -> 
Result<Vec<ArrayRef>> {
                 let mut aligned_array = array.clone();
                 for _ in 0..(max_ndim - ndim) {
                     let data_type = aligned_array.as_ref().data_type().clone();
-                    aligned_array = array_array(&[aligned_array], data_type)?;
+                    let offsets: Vec<i32> =
+                        (0..downcast_arg!(aligned_array, 
ListArray).offsets().len())
+                            .map(|i| i as i32)
+                            .collect();
+                    let field = Arc::new(Field::new("item", data_type, true));
+
+                    aligned_array = Arc::new(ListArray::try_new(

Review Comment:
   Is there a method how to push `NULL`s into `ListArray::try_new` with saving 
values? 🤔
   @tustvold, can you give me some advice if you have free time.



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