toppyy commented on code in PR #1427:
URL:
https://github.com/apache/datafusion-python/pull/1427#discussion_r2961459725
##########
docs/source/user-guide/data-sources.rst:
##########
@@ -224,25 +224,33 @@ A common technique for organizing tables is using a three
level hierarchical app
supports this form of organizing using the
:py:class:`~datafusion.catalog.Catalog`,
:py:class:`~datafusion.catalog.Schema`, and
:py:class:`~datafusion.catalog.Table`. By default,
a :py:class:`~datafusion.context.SessionContext` comes with a single Catalog
and a single Schema
-with the names ``datafusion`` and ``default``, respectively.
+with the names ``datafusion`` and ``public``, respectively.
The default implementation uses an in-memory approach to the catalog and
schema. We have support
-for adding additional in-memory catalogs and schemas. This can be done like in
the following
+for adding additional in-memory catalogs and schemas. You can access tables
registered in a schema
+either through the Dataframe API or vial sql commands. This can be done like
in the following
example:
.. code-block:: python
from datafusion.catalog import Catalog, Schema
+ from datafusion import SessionContext
+
+ ctx = SessionContext()
- my_catalog = Catalog.memory_catalog()
- my_schema = Schema.memory_schema()
+ my_catalog = Catalog.memory_catalog()
+ my_schema = Schema.memory_schema()
my_catalog.register_schema("my_schema_name", my_schema)
+ ctx.register_catalog_provider("my_catalog_name", my_catalog)
+
+ df = ctx.read_csv("pokemon.csv")
Review Comment:
great idea! thanks.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]