houqp commented on issue #824:
URL: 
https://github.com/apache/arrow-datafusion/issues/824#issuecomment-894021340


   @yjshen based on the sample code in your io source PR, it looks like you 
want the following API as a consumer of datafusion:
   
   ```rust
   let ctx = ExecutionContext::get();  // returns global context singleton
   ExecutionContext::set(ctx);  // updates global context singleton
   ```
   
   If so, I think this pattern can be implemented entirely within a 
self-contained crate that can be published in crates.io. The global singleton 
context crate could provide a get/set API like so:
   
   ```rust
   let ctx = global_df_ctx::get();
   global_df_ctx::set(ctx);
   ```
   
   The end user experience would stay the same, but the code would be better 
decoupled and users can choose to opt-in to the feature by simply adding the 
extension crate as a dependency.


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