Skip to content
Merged
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
5 changes: 2 additions & 3 deletions datafusion/core/tests/memory_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use arrow_schema::SortOptions;
use async_trait::async_trait;
use datafusion::assert_batches_eq;
use datafusion::physical_optimizer::PhysicalOptimizerRule;
use datafusion::physical_plan::common::batch_byte_size;
use datafusion::physical_plan::memory::MemoryExec;
use datafusion::physical_plan::streaming::PartitionStream;
use datafusion_expr::{Expr, TableType};
Expand Down Expand Up @@ -603,15 +602,15 @@ fn make_dict_batches() -> Vec<RecordBatch> {
let batches: Vec<_> = gen.take(num_batches).collect();

batches.iter().enumerate().for_each(|(i, batch)| {
println!("Dict batch[{i}] size is: {}", batch_byte_size(batch));
println!("Dict batch[{i}] size is: {}", batch.get_array_memory_size());
});

batches
}

// How many bytes does the memory from dict_batches consume?
fn batches_byte_size(batches: &[RecordBatch]) -> usize {
batches.iter().map(batch_byte_size).sum()
batches.iter().map(|b| b.get_array_memory_size()).sum()
}

struct DummyStreamPartition {
Expand Down