mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-18 05:50:41 +00:00
build(deps): upgrade opendal to 0.46 (#4037)
* build(deps): upgrade opendal to 0.46 Signed-off-by: tison <wander4096@gmail.com> * migrate writes Signed-off-by: tison <wander4096@gmail.com> * migrate reads Signed-off-by: tison <wander4096@gmail.com> * fixup object safety Signed-off-by: tison <wander4096@gmail.com> * fixup names Signed-off-by: tison <wander4096@gmail.com> * fixup compilation Signed-off-by: tison <wander4096@gmail.com> * fixup compilation Signed-off-by: tison <wander4096@gmail.com> * a few Buffer to Vec Signed-off-by: tison <wander4096@gmail.com> * Make greptime buildable with opendal 0.46 (#5) Signed-off-by: Xuanwo <github@xuanwo.io> * fixup toml check Signed-off-by: tison <wander4096@gmail.com> * test_orc_opener Signed-off-by: tison <wander4096@gmail.com> * Fix lru cache (#6) Signed-off-by: Xuanwo <github@xuanwo.io> * clippy Signed-off-by: tison <wander4096@gmail.com> * improve comments Signed-off-by: tison <wander4096@gmail.com> * address comments Signed-off-by: tison <wander4096@gmail.com> * reduce buf copy Signed-off-by: tison <wander4096@gmail.com> * upgrade to reqwest 0.12 Signed-off-by: tison <wander4096@gmail.com> --------- Signed-off-by: tison <wander4096@gmail.com> Signed-off-by: Xuanwo <github@xuanwo.io> Co-authored-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
@@ -56,6 +56,7 @@ store-api.workspace = true
|
||||
substrait.workspace = true
|
||||
table.workspace = true
|
||||
tokio.workspace = true
|
||||
tokio-util.workspace = true
|
||||
tonic.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -20,7 +20,7 @@ use client::{Output, OutputData, OutputMeta};
|
||||
use common_base::readable_size::ReadableSize;
|
||||
use common_datasource::file_format::csv::{CsvConfigBuilder, CsvFormat, CsvOpener};
|
||||
use common_datasource::file_format::json::{JsonFormat, JsonOpener};
|
||||
use common_datasource::file_format::orc::{infer_orc_schema, new_orc_stream_reader};
|
||||
use common_datasource::file_format::orc::{infer_orc_schema, new_orc_stream_reader, ReaderAdapter};
|
||||
use common_datasource::file_format::{FileFormat, Format};
|
||||
use common_datasource::lister::{Lister, Source};
|
||||
use common_datasource::object_store::{build_backend, parse_url};
|
||||
@@ -46,6 +46,7 @@ use session::context::QueryContextRef;
|
||||
use snafu::ResultExt;
|
||||
use table::requests::{CopyTableRequest, InsertRequest};
|
||||
use table::table_reference::TableReference;
|
||||
use tokio_util::compat::FuturesAsyncReadCompatExt;
|
||||
|
||||
use crate::error::{self, IntoVectorsSnafu, Result};
|
||||
use crate::statement::StatementExecutor;
|
||||
@@ -146,10 +147,16 @@ impl StatementExecutor {
|
||||
path,
|
||||
}),
|
||||
Format::Parquet(_) => {
|
||||
let meta = object_store
|
||||
.stat(&path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path: &path })?;
|
||||
let mut reader = object_store
|
||||
.reader(&path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path: &path })?;
|
||||
.context(error::ReadObjectSnafu { path: &path })?
|
||||
.into_futures_async_read(0..meta.content_length())
|
||||
.compat();
|
||||
let metadata = ArrowReaderMetadata::load_async(&mut reader, Default::default())
|
||||
.await
|
||||
.context(error::ReadParquetMetadataSnafu)?;
|
||||
@@ -161,12 +168,17 @@ impl StatementExecutor {
|
||||
})
|
||||
}
|
||||
Format::Orc(_) => {
|
||||
let meta = object_store
|
||||
.stat(&path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path: &path })?;
|
||||
|
||||
let reader = object_store
|
||||
.reader(&path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path: &path })?;
|
||||
|
||||
let schema = infer_orc_schema(reader)
|
||||
let schema = infer_orc_schema(ReaderAdapter::new(reader, meta.content_length()))
|
||||
.await
|
||||
.context(error::ReadOrcSnafu)?;
|
||||
|
||||
@@ -279,11 +291,17 @@ impl StatementExecutor {
|
||||
)))
|
||||
}
|
||||
FileMetadata::Parquet { metadata, path, .. } => {
|
||||
let reader = object_store
|
||||
.reader_with(path)
|
||||
.buffer(DEFAULT_READ_BUFFER)
|
||||
let meta = object_store
|
||||
.stat(path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path })?;
|
||||
let reader = object_store
|
||||
.reader_with(path)
|
||||
.chunk(DEFAULT_READ_BUFFER)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path })?
|
||||
.into_futures_async_read(0..meta.content_length())
|
||||
.compat();
|
||||
let builder =
|
||||
ParquetRecordBatchStreamBuilder::new_with_metadata(reader, metadata.clone());
|
||||
let stream = builder
|
||||
@@ -302,14 +320,20 @@ impl StatementExecutor {
|
||||
)))
|
||||
}
|
||||
FileMetadata::Orc { path, .. } => {
|
||||
let reader = object_store
|
||||
.reader_with(path)
|
||||
.buffer(DEFAULT_READ_BUFFER)
|
||||
let meta = object_store
|
||||
.stat(path)
|
||||
.await
|
||||
.context(error::ReadObjectSnafu { path })?;
|
||||
let stream = new_orc_stream_reader(reader)
|
||||
|
||||
let reader = object_store
|
||||
.reader_with(path)
|
||||
.chunk(DEFAULT_READ_BUFFER)
|
||||
.await
|
||||
.context(error::ReadOrcSnafu)?;
|
||||
.context(error::ReadObjectSnafu { path })?;
|
||||
let stream =
|
||||
new_orc_stream_reader(ReaderAdapter::new(reader, meta.content_length()))
|
||||
.await
|
||||
.context(error::ReadOrcSnafu)?;
|
||||
|
||||
let projected_schema = Arc::new(
|
||||
compat_schema
|
||||
|
||||
Reference in New Issue
Block a user