Daft Catalogs#
Warning
These APIs are early in their development. Please feel free to open feature requests and file issues. We'd love hear what you would like, thank you! 🤘
Catalogs are a centralized place to organize and govern your data. It is often responsible for creating objects such as tables and namespaces, managing transactions, and access control. Most importantly, the catalog abstracts away physical storage details, letting you focus on the logical structure of your data without worrying about file formats, partitioning schemes, or storage locations.
Daft integrates with various catalog implementations using its Catalog
and Table
interfaces. These are high-level APIs to manage catalog objects (tables and namespaces), while also making it easy to leverage Daft's existing daft.read_
and df.write_
APIs for open table formats like Iceberg and Delta Lake.
Example#
Note
These examples use the Iceberg Catalog from the Daft Sessions tutorial.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
Usage#
This section covers detailed usage of the current APIs with some code snippets.
Working with Catalogs#
The Catalog
interface allows you to perform catalog actions like get_table
and list_tables
.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
Working with Tables#
The Table
interface is a bridge from catalogs to dataframes. We can read tables into dataframes, and we can write dataframes to tables. You can work with a table independently of a catalog by using one of the factory methods, but it might not appear to provide that much utility over the existing daft.read_
and daft.write_
APIs. You would be correct in assuming that this is what is happening under the hood! The Table
interface provides indirection over the table format itself and serves as a single abstraction for reading and writing that our catalogs can work with.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Note
Today you can read from pyiceberg
and daft.unity
table objects.
Reference#
Note
For complete documentation, please see the Catalog & Table API docs.
- Catalog - Interface for creating and accessing both tables and namespaces
- Identifier - Paths to objects e.g.
catalog.namespace.table
- Table - Interface for reading and writing dataframes