Skip to content

Commit da9ebd3

Browse files
committed
[WIP] opendal writes
1 parent 0529b66 commit da9ebd3

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

native/core/src/parquet/parquet_support.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,28 +489,42 @@ pub(crate) fn prepare_object_store_with_configs(
489489

490490
#[cfg(test)]
491491
mod tests {
492-
use crate::execution::operators::ExecutionError;
493-
use crate::parquet::parquet_support::prepare_object_store_with_configs;
494492
use datafusion::execution::object_store::ObjectStoreUrl;
495493
use datafusion::execution::runtime_env::RuntimeEnv;
496494
use object_store::path::Path;
497-
use std::collections::HashMap;
498495
use std::sync::Arc;
496+
use url::Url;
497+
498+
#[cfg(all(not(feature = "hdfs"), not(feature = "hdfs-opendal")))]
499+
use crate::execution::operators::ExecutionError;
500+
#[cfg(all(not(feature = "hdfs"), not(feature = "hdfs-opendal")))]
501+
use std::collections::HashMap;
499502

500503
/// Parses the url, registers the object store, and returns a tuple of the object store url and object store path
501504
#[cfg(all(not(feature = "hdfs"), not(feature = "hdfs-opendal")))]
502505
pub(crate) fn prepare_object_store(
503506
runtime_env: Arc<RuntimeEnv>,
504507
url: String,
505508
) -> Result<(ObjectStoreUrl, Path), ExecutionError> {
509+
use crate::parquet::parquet_support::prepare_object_store_with_configs;
510+
prepare_object_store_with_configs(runtime_env, url, &HashMap::new())
511+
}
512+
513+
/// Parses the url, registers the object store, and returns a tuple of the object store url and object store path
514+
#[cfg(feature = "hdfs")]
515+
pub(crate) fn prepare_object_store(
516+
runtime_env: Arc<RuntimeEnv>,
517+
url: String,
518+
) -> Result<(ObjectStoreUrl, Path), crate::execution::operators::ExecutionError> {
519+
use crate::parquet::parquet_support::prepare_object_store_with_configs;
520+
use std::collections::HashMap;
506521
prepare_object_store_with_configs(runtime_env, url, &HashMap::new())
507522
}
508523

509524
#[cfg(all(not(feature = "hdfs"), not(feature = "hdfs-opendal")))]
510525
#[test]
511526
fn test_prepare_object_store() {
512527
use crate::execution::operators::ExecutionError;
513-
use url::Url;
514528

515529
let local_file_system_url = "file:///comet/spark-warehouse/part-00000.snappy.parquet";
516530
let hdfs_url = "hdfs://localhost:8020/comet/spark-warehouse/part-00000.snappy.parquet";

0 commit comments

Comments
 (0)