Expand description
Code for incremental view maintenance against Hive-partitioned tables.
An example of a Hive-partitioned table is the ListingTable.
By analyzing the fragment of the materialized view query pertaining to the partition columns,
we can derive a build graph that relates the files of a materialized views and the files of the tables it depends on.
Two central traits are defined:
ListingTableLike: a trait that abstracts Hive-partitioned tables in object storage;Materialized: a materializedListingTableLikedefined by a user-provided query.
Note that all implementations of ListingTableLike and Materialized must be registered using the
register_listing_table and
register_materialized functions respectively,
otherwise the tables may not be detected by the incremental view maintenance code,
including components such as FileMetadata,
RowMetadataRegistry, or the
mv_dependencies UDTF.
By default, ListingTableLike is implemented for ListingTable,
Modules§
- dependencies
- This module implements a dependency analysis algorithm for materialized views, heavily based on the
ListingTableLiketrait. Note that materialized views may depend on tables that are notListingTableLike, as long as they have custom metadata explicitly installed into theRowMetadataRegistry. However, materialized views themself must implementListingTableLike, as is implied by the type boundMaterialized: ListingTableLike. - file_
metadata - A virtual table that exposes files in object storage.
- row_
metadata - Pluggable metadata sources for incremental view maintenance
Constants§
- META_
COLUMN - The identifier of the column that
RowMetadataSourceimplementations should store row metadata in.
Traits§
- Decorator
- A
TableProviderthat decorates otherTableProviders. Sometimes users may implement aTableProviderthat overrides functionality of a baseTableProvider. This API allows the decorator to also be recognized asListingTableLikeorMaterializedautomatically. - Listing
Table Like - A
TableProviderwhose data is backed by Hive-partitioned files in object storage. - Materialized
- A hive-partitioned table in object storage that is defined by a user-provided query.
Functions§
- cast_
to_ listing_ table - Attempt to cast the given TableProvider into a
ListingTableLike. If the table’s type has not been registered usingregister_listing_table, will returnNone. - cast_
to_ materialized - Attempt to cast the given TableProvider into a
Materialized. If the table’s type has not been registered usingregister_materialized, will returnOk(None). - register_
decorator - Register
Tas aDecorator. - register_
listing_ table - Register a
ListingTableLikeimplementation in this registry. This allowscast_to_listing_tableto easily downcast aTableProviderinto aListingTableLikewhere possible. - register_
materialized - Register a
Materializedimplementation in this registry. This allowscast_to_materializedto easily downcast aTableProviderinto aMaterializedwhere possible.