apache / datafusion-python

Apache DataFusion Python Bindings
https://datafusion.apache.org/python
Apache License 2.0
356 stars 71 forks source link

Expose SQLOptions in python binding #567

Closed emanueledomingo closed 5 months ago

emanueledomingo commented 8 months ago

Hi Everyone,

Is your feature request related to a problem or challenge? Please describe what you are trying to do. I'd like to prevent DDL queries while executing them over my Datafusion Context, being them only for analytical purposes.

Describe the solution you'd like I've seen in the rust library that this is possible by setting SQLOptions and use the sql_with_options function. Unfortunately, this is not being exposed by this python binding:

https://github.com/apache/arrow-datafusion-python/blob/7de4316b70dd1b2aeed68bfee293d95a2cc384b5/src/context.rs#L282-L286

It uses .sql under the hood, that creates default values for SQLOptions, by setting every flag to true.

It will be very nice to have the possibility to configure SQLOptions also from the python binding.