Skip to content

Commit 7f28533

Browse files
Add support for Azure (#599)
1 parent 03e351f commit 7f28533

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ballista/client/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ default = []
4545
hdfs = ["ballista-core/hdfs"]
4646
hdfs3 = ["ballista-core/hdfs3"]
4747
s3 = ["ballista-core/s3"]
48+
azure = ["ballista-core/azure"]
4849
standalone = ["ballista-executor", "ballista-scheduler"]

ballista/core/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ force_hash_collisions = ["datafusion/force_hash_collisions"]
4040
hdfs = ["datafusion-objectstore-hdfs/hdfs"]
4141
hdfs3 = ["datafusion-objectstore-hdfs/hdfs3"]
4242
s3 = ["object_store/aws"]
43+
azure = ["object_store/azure"]
4344
simd = ["datafusion/simd"]
4445

4546
[dependencies]

ballista/core/src/utils.rs

+14
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ use futures::StreamExt;
5252
use log::error;
5353
#[cfg(feature = "s3")]
5454
use object_store::aws::AmazonS3Builder;
55+
#[cfg(feature = "azure")]
56+
use object_store::azure::MicrosoftAzureBuilder;
5557
use object_store::ObjectStore;
5658
use std::io::{BufWriter, Write};
5759
use std::marker::PhantomData;
@@ -120,6 +122,18 @@ impl ObjectStoreProvider for FeatureBasedObjectStoreProvider {
120122
}
121123
}
122124

125+
#[cfg(feature = "azure")]
126+
{
127+
if url.to_string().starts_with("azure://") {
128+
if let Some(bucket_name) = url.host_str() {
129+
let store = MicrosoftAzureBuilder::from_env()
130+
.with_container_name(bucket_name)
131+
.build()?;
132+
return Ok(Arc::new(store));
133+
}
134+
}
135+
}
136+
123137
Err(DataFusionError::Execution(format!(
124138
"No object store available for {}",
125139
url

0 commit comments

Comments
 (0)