Skip to content

Commit 27aecb6

Browse files
authored
feat: Translate Hadoop S3A configurations to object_store configurations (apache#1817)
1 parent 770f637 commit 27aecb6

File tree

15 files changed

+2901
-31
lines changed

15 files changed

+2901
-31
lines changed

native/Cargo.lock

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

native/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ regex = "1.9.6"
5151
thiserror = "2"
5252
object_store = { version = "0.12.0", features = ["gcp", "azure", "aws", "http"] }
5353
url = "2.2"
54+
aws-config = "1.6.3"
55+
aws-credential-types = "1.2.3"
5456

5557
[profile.release]
5658
debug = true

native/core/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ datafusion-comet-spark-expr = { workspace = true }
6969
datafusion-comet-proto = { workspace = true }
7070
object_store = { workspace = true }
7171
url = { workspace = true }
72+
aws-config = { workspace = true }
73+
aws-credential-types = { workspace = true }
7274
parking_lot = "0.12.3"
7375
datafusion-comet-objectstore-hdfs = { path = "../hdfs", optional = true, default-features = false, features = ["hdfs"] }
7476

native/core/src/execution/planner.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use datafusion_comet_spark_expr::{create_comet_physical_fun, create_negate_expr,
6969
use crate::execution::operators::ExecutionError::GeneralError;
7070
use crate::execution::shuffle::CompressionCodec;
7171
use crate::execution::spark_plan::SparkPlan;
72-
use crate::parquet::parquet_support::prepare_object_store;
72+
use crate::parquet::parquet_support::prepare_object_store_with_configs;
7373
use datafusion::common::scalar::ScalarStructBuilder;
7474
use datafusion::common::{
7575
tree_node::{Transformed, TransformedResult, TreeNode, TreeNodeRecursion, TreeNodeRewriter},
@@ -1156,8 +1156,17 @@ impl PhysicalPlanner {
11561156
.and_then(|f| f.partitioned_file.first())
11571157
.map(|f| f.file_path.clone())
11581158
.ok_or(GeneralError("Failed to locate file".to_string()))?;
1159-
let (object_store_url, _) =
1160-
prepare_object_store(self.session_ctx.runtime_env(), one_file)?;
1159+
1160+
let object_store_options: HashMap<String, String> = scan
1161+
.object_store_options
1162+
.iter()
1163+
.map(|(k, v)| (k.clone(), v.clone()))
1164+
.collect();
1165+
let (object_store_url, _) = prepare_object_store_with_configs(
1166+
self.session_ctx.runtime_env(),
1167+
one_file,
1168+
&object_store_options,
1169+
)?;
11611170

11621171
// Generate file groups
11631172
let mut file_groups: Vec<Vec<PartitionedFile>> =

native/core/src/parquet/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pub mod parquet_support;
2626
pub mod read;
2727
pub mod schema_adapter;
2828

29+
mod objectstore;
30+
2931
use std::task::Poll;
3032
use std::{boxed::Box, ptr::NonNull, sync::Arc};
3133

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
pub mod s3;

0 commit comments

Comments
 (0)