-
Notifications
You must be signed in to change notification settings - Fork 290
Support loading custom catalog implementation #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @Fokko @HonahX @syun64 @kevinjqliu |
I like the option to load a custom catalog implementation. As long as the implementation subclasses Catalog and have all the necessary functions implemented. We would also add a new (CatalogType) It'll be great if we have a set of tests to encode specific catalog behaviors, similar to #813 On a meta level, the customer can also "wrap" their custom catalog implementation with the REST protocol. Similar to how the iceberg-rest-image is implemented |
Yes we brought up that solution, but they do not want to maintain this additional layer of indirection that could cause additional availability, latency, security issues. |
Hi @jackye1995 - I'm of the opinion that this is totally fine. If the client wants to have their own catalog implementation for any of many possible reasons (e.g. because it requires a specific auth mechanism) they should be allowed to. I'm actually wondering what about the state of code right now, would prevent them from having their own implementation. I want to hold off on giving a definite answer before actually trying this out, but I think even now, they should be able to implement the But maybe there is value allowing load_catalog to parse properties for custom catalogs for ease of use. |
+1. I think it is beneficial for For example, it would allow users to define custom catalogs in the following way: custom:
py-catalog-impl: example.catalog.ExampleCatalog
custom.property-a: a
custom.property-b: b Then, they can load the catalog in their code with: catalog = load_catalog("custom") IMO, Inspired by the discussions of custom implementation of iceberg-python/pyiceberg/catalog/__init__.py Lines 459 to 473 in 301e336
We may also add some guide like Java Custom Catalog, especially for Would love to hear more thoughts on these! Thanks for all the valuable discussions above. |
Yes, I think that would be a nice addition. As Jack already pointed out, we already have dynamic loading of file-io's using You could also inherit from an existing catalog if you want to extend certain parts of it (for example, the authentication mechanism as Sung pointed out). I'm all for it 👍 |
I can give a try for it, assigning to myself. |
Would it hurt to add some checks to the custom catalog implementation passed in to ensure that a core suite of methods are provided in the custom implementation? I can imagine a user creating a custom catalog with not everything implemented and really shooting themselves in the foot. I suppose why not enforce the custom catalog to inherit from the abstract |
I think behavior checking for custom catalogs is a nice-to-have feature, but ultimately it is up to the implementation to make sure the catalog behaves correctly. |
The type hint Personally speaking I prefer to not check it. I see it as an advantage of Python vs strictly typed languages like Java to allow not inheriting a interface during dynamic loading, so it is more flexible for people that could leverage it. But I would imagine most people with custom implementation is inheriting the |
Feature Request / Improvement
We have a customer asking about the ability to load a custom catalog implementation, similar to how Java Iceberg works today by loading a custom Java class path. The customer understands that the community would like to go with REST catalog in general, but they are not ready to onboard to that yet for at least a year or two.
I see something similar done in FileIO path. What is our general thoughts around this topic? Are we open to add similar support for catalog when doing
load_catalog
?The text was updated successfully, but these errors were encountered: