Skip to content

Commit

Permalink
refactor: remove reduntant .compat() (#2949)
Browse files Browse the repository at this point in the history
* refactor: remove reduntant `.compat()`

Signed-off-by: Zhenchi <[email protected]>

* remove dep

Signed-off-by: Zhenchi <[email protected]>

---------

Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored Dec 18, 2023
1 parent 029ff2f commit d339191
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/mito2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ api.workspace = true
aquamarine.workspace = true
arc-swap = "1.6"
async-channel = "1.9"
async-compat = "0.2"
async-stream.workspace = true
async-trait = "0.1"
bytes.workspace = true
Expand Down
6 changes: 2 additions & 4 deletions src/mito2/src/sst/parquet/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use std::collections::{HashSet, VecDeque};
use std::sync::Arc;
use std::time::{Duration, Instant};

use async_compat::{Compat, CompatExt};
use async_trait::async_trait;
use common_telemetry::debug;
use common_time::range::TimestampRange;
Expand Down Expand Up @@ -123,8 +122,7 @@ impl ParquetReaderBuilder {
.object_store
.reader(&file_path)
.await
.context(OpenDalSnafu)?
.compat();
.context(OpenDalSnafu)?;
let mut reader = BufReader::new(reader);
// Loads parquet metadata of the file.
let parquet_meta = self.read_parquet_metadata(&mut reader, &file_path).await?;
Expand Down Expand Up @@ -288,7 +286,7 @@ struct RowGroupReaderBuilder {
/// Metadata of the parquet file.
parquet_meta: Arc<ParquetMetaData>,
/// Reader to get data.
file_reader: BufReader<Compat<Reader>>,
file_reader: BufReader<Reader>,
/// Projection mask.
projection: ProjectionMask,
/// Field levels to read.
Expand Down
1 change: 0 additions & 1 deletion src/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ testing = []

[dependencies]
api.workspace = true
async-compat = "0.2"
async-trait = "0.1"
auth.workspace = true
catalog.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions src/operator/src/statement/copy_table_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::collections::HashMap;
use std::future::Future;
use std::sync::Arc;

use async_compat::CompatExt;
use common_base::readable_size::ReadableSize;
use common_datasource::file_format::csv::{CsvConfigBuilder, CsvOpener};
use common_datasource::file_format::json::JsonOpener;
Expand Down Expand Up @@ -205,8 +204,7 @@ impl StatementExecutor {
.reader(path)
.await
.context(error::ReadObjectSnafu { path })?;

let buf_reader = BufReader::new(reader.compat());
let buf_reader = BufReader::new(reader);

let builder = ParquetRecordBatchStreamBuilder::new(buf_reader)
.await
Expand Down

0 comments on commit d339191

Please sign in to comment.