alamb commented on code in PR #5543:
URL: https://github.com/apache/opendal/pull/5543#discussion_r1914821230
##########
integrations/object_store/examples/datafusion.rs:
##########
@@ -0,0 +1,52 @@
+use datafusion::error::DataFusionError;
+use datafusion::error::Result;
+use datafusion::prelude::*;
+use opendal::services::S3;
+use opendal::Operator;
+use std::sync::Arc;
+use url::Url;
+
+/// This example demonstrates querying data in a S3 bucket using DataFusion
and `object_store_opendal`
+#[tokio::main]
+async fn main() -> Result<()> {
+ let ctx = SessionContext::new();
+
+ // Configure OpenDAL for S3
+ let region = "my_region";
+ let bucket_name = "my_bucket";
+ let builder = S3::default()
+ .endpoint("my_endpoint")
+ .bucket(bucket_name)
+ .region(region)
+ .access_key_id("my_access_key")
+ .secret_access_key("my_secret_key");
+ let op = Operator::new(builder)
+ .map_err(|err| DataFusionError::External(Box::new(err)))?
+ .finish();
+ let store = object_store_opendal::OpendalStore::new(op);
Review Comment:
❤️ this is very cool
--
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]