yahoNanJing commented on code in PR #258:
URL: https://github.com/apache/arrow-ballista/pull/258#discussion_r976622823


##########
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:
   Yes, based on this PR, we can easily add feature-based object stores like 
#260 does. And we have one verified example in 
https://github.com/datafusion-contrib/datafusion-objectstore-hdfs/blob/master/hdfs-examples/src/bin/ballista-sql.rs



-- 
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]

Reply via email to