From 0faa6af266afe806f8b19796025226aa14584caf Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Tue, 21 May 2024 17:33:05 +0800 Subject: [PATCH] fix: some comments --- src/mito2/src/read/scan_region.rs | 3 +-- src/query/src/tests/time_range_filter_test.rs | 6 +++--- src/table/src/table/adapter.rs | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mito2/src/read/scan_region.rs b/src/mito2/src/read/scan_region.rs index 42080b3484a8..3b0ae2f52315 100644 --- a/src/mito2/src/read/scan_region.rs +++ b/src/mito2/src/read/scan_region.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use std::time::Instant; use common_recordbatch::SendableRecordBatchStream; -use common_telemetry::{debug, error, info, warn}; +use common_telemetry::{debug, error, warn}; use common_time::range::TimestampRange; use store_api::storage::ScanRequest; use table::predicate::{build_time_range_predicate, Predicate}; @@ -269,7 +269,6 @@ impl ScanRegion { ); let index_applier = self.build_index_applier(); - info!("Request filters: {:?}", self.request.filters); let predicate = Predicate::new(self.request.filters.clone()); // The mapper always computes projected column ids as the schema of SSTs may change. let mapper = match &self.request.projection { diff --git a/src/query/src/tests/time_range_filter_test.rs b/src/query/src/tests/time_range_filter_test.rs index 8ec57d848167..cf59ae40c595 100644 --- a/src/query/src/tests/time_range_filter_test.rs +++ b/src/query/src/tests/time_range_filter_test.rs @@ -114,14 +114,14 @@ struct TimeRangeTester { impl TimeRangeTester { async fn check(&self, sql: &str, expect: TimestampRange) { let _ = exec_selection(self.engine.clone(), sql).await; - let mut filters = self.get_filters(); + let mut filters = self.take_filters(); let range = build_time_range_predicate("ts", TimeUnit::Millisecond, &mut filters); assert_eq!(expect, range); } - fn get_filters(&self) -> Vec { - self.filter.write().unwrap().drain(..).collect() + fn take_filters(&self) -> Vec { + std::mem::take(&mut self.filter.write().unwrap()) } } diff --git a/src/table/src/table/adapter.rs b/src/table/src/table/adapter.rs index ffa4d13087af..ffc6618a548a 100644 --- a/src/table/src/table/adapter.rs +++ b/src/table/src/table/adapter.rs @@ -17,7 +17,6 @@ use std::sync::{Arc, Mutex}; use common_query::logical_plan::Expr; use common_recordbatch::OrderOption; -use common_telemetry::info; use datafusion::arrow::datatypes::SchemaRef as DfSchemaRef; use datafusion::datasource::{TableProvider, TableType as DfTableType}; use datafusion::error::Result as DfResult; @@ -86,7 +85,6 @@ impl TableProvider for DfTableProviderAdapter { limit: Option, ) -> DfResult> { let filters: Vec = filters.iter().map(Clone::clone).map(Into::into).collect(); - info!("Filters: {:?}", filters); let request = { let mut request = self.scan_req.lock().unwrap(); request.filters = filters;