Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ mod tests {
use crate::arrays::UnionArray;
use crate::arrays::VarBinViewArray;
use crate::arrays::VariantArray;
use crate::arrays::listview::ListViewRebuildMode;
use crate::builders::builder_with_capacity;
use crate::dtype::DType;
use crate::dtype::DecimalDType;
Expand Down Expand Up @@ -506,9 +507,21 @@ mod tests {
let array =
ListViewArray::new(elements, offsets, sizes, Validity::NonNullable).into_array();

// These lists are out of order and leave element 1 unreferenced. `ListViewBuilder` keeps
// the layout it is handed, so the builder round-trip inside
// `materialized_uncompressed_size_in_bytes` retains that element and no longer stands in
// for the logical size. Rebuild to the exact layout, which is what "materialized" means
// here.
let mut ctx = array_session().create_execution_ctx();
let exact = array
.clone()
.execute::<ListViewArray>(&mut ctx)?
.rebuild(ListViewRebuildMode::MakeExact, &mut ctx)?
.into_array();

assert_eq!(
aggregate(&array)?,
materialized_uncompressed_size_in_bytes(&array)
materialized_uncompressed_size_in_bytes(&exact)
);
Ok(())
}
Expand Down
Loading
Loading