Skip to content

Commit 5b62549

Browse files
authored
refactor: Bump OpenDAL to 0.53 (#1182)
## Which issue does this PR close? None ## What changes are included in this PR? Bump OpenDAL to 0.53, remove not needed hacks. ## Are these changes tested? None. --------- Signed-off-by: Xuanwo <[email protected]>
1 parent 7eb00d5 commit 5b62549

File tree

5 files changed

+13
-27
lines changed

5 files changed

+13
-27
lines changed

Cargo.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ mockito = "1"
7474
murmur3 = "0.5.2"
7575
num-bigint = "0.4.6"
7676
once_cell = "1.20"
77-
opendal = "0.51.2"
77+
opendal = "0.53.0"
7878
ordered-float = "4"
7979
parquet = "54.2.0"
8080
pilota = "0.11.2"

crates/iceberg/src/io/file_io.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ impl FileWrite for opendal::Writer {
309309
}
310310

311311
async fn close(&mut self) -> crate::Result<()> {
312-
Ok(opendal::Writer::close(self).await?)
312+
let _ = opendal::Writer::close(self).await?;
313+
Ok(())
313314
}
314315
}
315316

crates/iceberg/src/io/storage.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ pub(crate) enum Storage {
3939
/// s3 storage could have `s3://` and `s3a://`.
4040
/// Storing the scheme string here to return the correct path.
4141
scheme_str: String,
42-
/// uses the same client for one FileIO Storage.
43-
///
44-
/// TODO: allow users to configure this client.
45-
client: reqwest::Client,
4642
config: Arc<S3Config>,
4743
},
4844
#[cfg(feature = "storage-gcs")]
@@ -63,7 +59,6 @@ impl Storage {
6359
#[cfg(feature = "storage-s3")]
6460
Scheme::S3 => Ok(Self::S3 {
6561
scheme_str,
66-
client: reqwest::Client::new(),
6762
config: super::s3_config_parse(props)?.into(),
6863
}),
6964
#[cfg(feature = "storage-gcs")]
@@ -115,12 +110,8 @@ impl Storage {
115110
}
116111
}
117112
#[cfg(feature = "storage-s3")]
118-
Storage::S3 {
119-
scheme_str,
120-
client,
121-
config,
122-
} => {
123-
let op = super::s3_config_build(client, config, path)?;
113+
Storage::S3 { scheme_str, config } => {
114+
let op = super::s3_config_build(config, path)?;
124115
let op_info = op.info();
125116

126117
// Check prefix of s3 path.

crates/iceberg/src/io/storage_s3.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
use std::collections::HashMap;
1919

20-
use opendal::raw::HttpClient;
2120
use opendal::services::S3Config;
2221
use opendal::{Configurator, Operator};
2322
use url::Url;
@@ -152,11 +151,7 @@ pub(crate) fn s3_config_parse(mut m: HashMap<String, String>) -> Result<S3Config
152151
}
153152

154153
/// Build new opendal operator from give path.
155-
pub(crate) fn s3_config_build(
156-
client: &reqwest::Client,
157-
cfg: &S3Config,
158-
path: &str,
159-
) -> Result<Operator> {
154+
pub(crate) fn s3_config_build(cfg: &S3Config, path: &str) -> Result<Operator> {
160155
let url = Url::parse(path)?;
161156
let bucket = url.host_str().ok_or_else(|| {
162157
Error::new(
@@ -169,9 +164,7 @@ pub(crate) fn s3_config_build(
169164
.clone()
170165
.into_builder()
171166
// Set bucket name.
172-
.bucket(bucket)
173-
// Set http client we want to use.
174-
.http_client(HttpClient::with(client.clone()));
167+
.bucket(bucket);
175168

176169
Ok(Operator::new(builder)?.finish())
177170
}

0 commit comments

Comments
 (0)