alamb commented on code in PR #8121:
URL: https://github.com/apache/arrow-datafusion/pull/8121#discussion_r1398189552


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -2939,6 +3011,43 @@ mod tests {
             as_uint64_array(&arr).expect("failed to initialize function 
array_length");
 
         assert_eq!(result, &UInt64Array::from(vec![None]));
+

Review Comment:
   Rather than extending this module with more rust tests, can you perhaps add 
SQL level tests using sqllogictest?
   
   That will ensure the functions are usable end to end and that all the 
connections are in place
   
   Perhaps 
https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files/array.slt



##########
datafusion/common/src/scalar.rs:
##########
@@ -1716,7 +1716,11 @@ impl ScalarValue {
         } else {
             Self::iter_to_array(values.iter().cloned()).unwrap()
         };
-        Arc::new(array_into_list_array(values))
+        if values.len() <= i32::MAX as usize {

Review Comment:
   I think the ScalarValue type needs to match the underyling array type -- so 
with this change, a `ScalarValue::List` might return `LargeListArray` or 
`ListArray`. This mismatch will likely cause issues downstream
   
   I think the standard pattern would be to add a new function 
`ScalarValue::new_large_list` and `ScalarValue::LargeList` if they don't 
already exist



##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -3015,6 +3085,18 @@ mod tests {
         make_array(&args).expect("failed to initialize function array")
     }
 
+    fn return_large_array() -> ArrayRef {
+        // Returns: [1, 2, 3, 4]
+        let args = [
+            Arc::new(Int64Array::from(vec![Some(1)])) as ArrayRef,
+            Arc::new(Int64Array::from(vec![Some(2)])) as ArrayRef,
+            Arc::new(Int64Array::from(vec![Some(3)])) as ArrayRef,
+            Arc::new(Int64Array::from(vec![Some(4)])) as ArrayRef,
+        ];
+        let data_type = DataType::Int64;
+        array_array::<i64>(&args, data_type).expect("failed to initialize 
function array")
+    }
+

Review Comment:
   What is the hack? 



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to