andygrove commented on code in PR #258:
URL: https://github.com/apache/arrow-ballista/pull/258#discussion_r976574005
##########
ballista/rust/core/src/utils.rs:
##########
@@ -54,9 +56,38 @@ use std::time::Duration;
use std::{fs::File, pin::Pin};
use tonic::codegen::StdError;
use tonic::transport::{Channel, Error, Server};
+use url::Url;
-/// Stream data to disk in Arrow IPC format
+/// Default session builder using the provided configuration
+pub fn default_session_builder(config: SessionConfig) -> SessionState {
+ SessionState::with_config_rt(
+ config,
+ Arc::new(
+
RuntimeEnv::new(with_object_store_provider(RuntimeConfig::default()))
+ .unwrap(),
+ ),
+ )
+}
+
+/// Get a RuntimeConfig with specific ObjectStoreDetector in the
ObjectStoreRegistry
+pub fn with_object_store_provider(config: RuntimeConfig) -> RuntimeConfig {
+
config.with_object_store_registry(Arc::new(ObjectStoreRegistry::new_with_provider(
+ Some(Arc::new(FeatureBasedObjectStoreProvider)),
+ )))
+}
+/// An object store detector based on which features are enable for different
kinds of object stores
+pub struct FeatureBasedObjectStoreProvider;
Review Comment:
There is a follow-on PR https://github.com/apache/arrow-ballista/pull/260 to
implement this for HDFS but it is waiting on another PR to be merged
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]