From e4065505ab66334538ab9caa67cb4bff083527c4 Mon Sep 17 00:00:00 2001 From: evenyag Date: Tue, 8 Apr 2025 20:54:34 +0800 Subject: [PATCH] feat: use smallvec --- src/mito2/src/read/series_scan.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mito2/src/read/series_scan.rs b/src/mito2/src/read/series_scan.rs index a5a89fbdd3..adb71bc944 100644 --- a/src/mito2/src/read/series_scan.rs +++ b/src/mito2/src/read/series_scan.rs @@ -27,6 +27,7 @@ use datafusion::physical_plan::{DisplayAs, DisplayFormatType}; use datatypes::compute::concat_batches; use datatypes::schema::SchemaRef; use futures::StreamExt; +use smallvec::{smallvec, SmallVec}; use snafu::{ensure, OptionExt, ResultExt}; use store_api::metadata::RegionMetadataRef; use store_api::region_engine::{PartitionRange, PrepareRequest, RegionScanner, ScannerProperties}; @@ -384,15 +385,14 @@ impl SeriesDistributor { /// Batches of the same series. #[derive(Default)] struct SeriesBatch { - // FIXME: Use smallvec - batches: Vec, + batches: SmallVec<[Batch; 4]>, } impl SeriesBatch { /// Creates a new [SeriesBatch] from a single [Batch]. fn single(batch: Batch) -> Self { Self { - batches: vec![batch], + batches: smallvec![batch], } }