forked from apache/horaedb
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: init scan implementation for time merge storage (apache#1586)
## Rationale ## Detailed Changes ## Test Plan CI
- Loading branch information
1 parent
115b002
commit e65c504
Showing
7 changed files
with
260 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
|
||
pub mod error; | ||
mod manifest; | ||
mod read; | ||
mod sst; | ||
pub mod storage; | ||
pub mod types; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
use datafusion::{ | ||
datasource::physical_plan::{FileMeta, ParquetFileReaderFactory}, | ||
error::Result as DfResult, | ||
parquet::arrow::async_reader::AsyncFileReader, | ||
physical_plan::metrics::ExecutionPlanMetricsSet, | ||
}; | ||
use parquet::arrow::async_reader::ParquetObjectReader; | ||
|
||
use crate::types::ObjectStoreRef; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct DefaultParquetFileReaderFactory { | ||
object_store: ObjectStoreRef, | ||
} | ||
|
||
/// Returns a AsyncFileReader factory | ||
impl DefaultParquetFileReaderFactory { | ||
pub fn new(object_store: ObjectStoreRef) -> Self { | ||
Self { object_store } | ||
} | ||
} | ||
|
||
impl ParquetFileReaderFactory for DefaultParquetFileReaderFactory { | ||
fn create_reader( | ||
&self, | ||
_partition_index: usize, | ||
file_meta: FileMeta, | ||
metadata_size_hint: Option<usize>, | ||
_metrics: &ExecutionPlanMetricsSet, | ||
) -> DfResult<Box<dyn AsyncFileReader + Send>> { | ||
let object_store = self.object_store.clone(); | ||
let mut reader = ParquetObjectReader::new(object_store, file_meta.object_meta); | ||
if let Some(size) = metadata_size_hint { | ||
reader = reader.with_footer_size_hint(size); | ||
} | ||
Ok(Box::new(reader)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.