Skip to content

Conversation

@suremarc
Copy link
Collaborator

@suremarc suremarc commented Jan 8, 2025

This PR adds a new Decorator API that allows users of this library to register decorator implementations of TableProvider.

Decorators are useful for overriding functionality of existing TableProvider implementations. Sometimes, a user may implemented Materialized or ListingTableLike for a TableProvider, but then wrap this type with a decorator that doesn't implement either. In this case, whether or not the inner table implements Materialized or TableProvider can only be known at runtime by inspecting the inner TableProvider.

To simplify dealing with such cases, the user may register their decorator using register_decorator. For such types, if the cast_to_listing_table and cast_to_materialized functions fail, it will then check if the table is a decorator. If so, it will recursively check the inner table as well.

@suremarc suremarc merged commit 64eaabd into datafusion-contrib:main Jan 8, 2025
8 checks passed
@github-actions github-actions bot mentioned this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant