Jefffrey commented on code in PR #21669:
URL: https://github.com/apache/datafusion/pull/21669#discussion_r3105079095
##########
datafusion/common/src/utils/mod.rs:
##########
@@ -480,6 +481,32 @@ impl SingleRowListArrayBuilder {
ScalarValue::FixedSizeList(Arc::new(self.build_fixed_size_list_array(list_size)))
}
+ /// Build a single element [`ListViewArray`]
+ pub fn build_list_view_array(self) -> ListViewArray {
+ let (field, arr) = self.into_field_and_arr();
+ let offsets = ScalarBuffer::from(vec![0]);
+ let sizes = ScalarBuffer::from(vec![arr.len() as i32]);
Review Comment:
Fixed to use checked API; it'll panic if overflow but I don't think that'll
be a common usage
##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -1649,6 +1689,24 @@ impl ScalarValue {
let list = ScalarValue::new_large_list(&[], field.data_type());
Ok(ScalarValue::LargeList(list))
}
+ DataType::ListView(field) => {
+ let empty_arr = new_empty_array(field.data_type());
+ let values = Arc::new(
+ SingleRowListArrayBuilder::new(empty_arr)
+ .with_nullable(field.is_nullable())
Review Comment:
Fixed to use `with_field`, thanks
--
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]