Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: fix clippy for memory_limit test #7248

Merged
merged 1 commit into from
Aug 9, 2023
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