Jefffrey commented on code in PR #21669:
URL: https://github.com/apache/datafusion/pull/21669#discussion_r3105077534


##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -9651,6 +9962,17 @@ mod tests {
             _ => panic!("Expected List"),
         }
 
+        let list_result =
+            
ScalarValue::new_default(&DataType::ListView(Arc::new(list_field.clone())))
+                .unwrap();
+        match list_result {
+            ScalarValue::ListView(arr) => {
+                assert_eq!(arr.len(), 1);
+                assert_eq!(arr.value_size(0), 0); // empty list
+            }
+            _ => panic!("Expected List"),
+        }

Review Comment:
   Added



##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -9760,6 +10082,14 @@ mod tests {
             )))),
             None
         );
+        assert_eq!(
+            ScalarValue::min(&DataType::ListView(Arc::new(Field::new(
+                "item",
+                DataType::Int32,
+                true
+            )))),
+            None
+        );

Review Comment:
   Added



##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -9836,6 +10166,14 @@ mod tests {
             )]))),
             None
         );
+        assert_eq!(
+            ScalarValue::max(&DataType::ListView(Arc::new(Field::new(
+                "item",
+                DataType::Int32,
+                true
+            )))),
+            None
+        );

Review Comment:
   Added



##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -662,15 +675,26 @@ impl PartialOrd for ScalarValue {
             (FixedSizeBinary(_, _), _) => None,
             (LargeBinary(v1), LargeBinary(v2)) => v1.partial_cmp(v2),
             (LargeBinary(_), _) => None,
-            // ScalarValue::List / ScalarValue::FixedSizeList / 
ScalarValue::LargeList are ensure to have length 1
+            // ScalarValue::List / ScalarValue::FixedSizeList / 
ScalarValue::LargeList / ScalarValue::ListView / ScalarValue::LargeListView
+            // are ensure to have length 1

Review Comment:
   Fixed



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

Reply via email to