NickCrews commented on issue #1106:
URL: 
https://github.com/apache/datafusion-python/issues/1106#issuecomment-2800092336

   I don't super understand #1103, but I think that is maybe the inverse: that 
issue is about allowing devs to provide datafusion with ways to access they 
custom databases/catalogs that exist elsewhere in python-land. I think my use 
case is much more simple, the other direction: given an existing datafusion 
context, get the name of the current database/catalog.
   
   After looking around the docs a bit more, I think I actually found the 
solution
   
   ```python
   from datafusion import SessionContext
   
   ctx = SessionContext()
   sql = "select value from information_schema.df_settings where 
name='datafusion.catalog.default_catalog'"
   ctx.sql(sql)
   # 'datafusion'
   ```


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to