diff --git a/read_buffer/benches/dictionary.rs b/read_buffer/benches/dictionary.rs index a9d05e3ced..bb3aff61bc 100644 --- a/read_buffer/benches/dictionary.rs +++ b/read_buffer/benches/dictionary.rs @@ -3,7 +3,7 @@ use rand::distributions::Alphanumeric; use rand::prelude::*; use rand::Rng; -use read_buffer::{column::cmp::Operator, column::dictionary, column::RowIDs}; +use read_buffer::benchmarks::{dictionary, Operator, RowIDs}; const ROWS: [usize; 3] = [100_000, 1_000_000, 10_000_000]; const LOCATIONS: [Location; 3] = [Location::Start, Location::Middle, Location::End]; diff --git a/read_buffer/benches/fixed.rs b/read_buffer/benches/fixed.rs index 35b6dff55c..f681d56030 100644 --- a/read_buffer/benches/fixed.rs +++ b/read_buffer/benches/fixed.rs @@ -4,8 +4,8 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Through use rand::prelude::*; use arrow_deps::arrow::datatypes::*; -use read_buffer::column::fixed::Fixed; -use read_buffer::column::fixed_null::FixedNull; +use read_buffer::benchmarks::Fixed; +use read_buffer::benchmarks::FixedNull; const ROWS: [usize; 5] = [10, 100, 1_000, 10_000, 60_000]; const CHUNKS: [Chunks; 4] = [ diff --git a/read_buffer/benches/plain.rs b/read_buffer/benches/plain.rs index 35b6dff55c..f681d56030 100644 --- a/read_buffer/benches/plain.rs +++ b/read_buffer/benches/plain.rs @@ -4,8 +4,8 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Through use rand::prelude::*; use arrow_deps::arrow::datatypes::*; -use read_buffer::column::fixed::Fixed; -use read_buffer::column::fixed_null::FixedNull; +use read_buffer::benchmarks::Fixed; +use read_buffer::benchmarks::FixedNull; const ROWS: [usize; 5] = [10, 100, 1_000, 10_000, 60_000]; const CHUNKS: [Chunks; 4] = [ diff --git a/read_buffer/benches/row_group.rs b/read_buffer/benches/row_group.rs index 9cc815e603..fb243998da 100644 --- a/read_buffer/benches/row_group.rs +++ b/read_buffer/benches/row_group.rs @@ -7,9 +7,8 @@ use rand::Rng; use rand_distr::{Distribution, Normal}; use packers::{sorter, Packers}; - -use read_buffer::column::{AggregateType, Column}; -use read_buffer::row_group::{ColumnType, Predicate, RowGroup}; +use read_buffer::benchmarks::{Column, ColumnType, RowGroup}; +use read_buffer::{AggregateType, Predicate}; const ONE_MS: i64 = 1_000_000; diff --git a/read_buffer/src/lib.rs b/read_buffer/src/lib.rs index a2f9c85ee7..e8e02bd5b6 100644 --- a/read_buffer/src/lib.rs +++ b/read_buffer/src/lib.rs @@ -1017,3 +1017,17 @@ mod test { assert!(itr.next().is_none()); } } + +/// THIS MODULE SHOULD ONLY BE IMPORTED FOR BENCHMARKS. +/// +/// This module lets us expose internal parts of the crate so that we can use +/// libraries like criterion for benchmarking. +/// +/// It should not be imported into any non-testing or benchmarking crates. +pub mod benchmarks { + pub use crate::column::{ + cmp::Operator, dictionary, fixed::Fixed, fixed_null::FixedNull, Column, RowIDs, + }; + + pub use crate::row_group::{ColumnType, RowGroup}; +}