-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DA][perf] Avoid recomputing in progress subset #22734
base: master
Are you sure you want to change the base?
Conversation
asset_record | ||
and stored_cache_value | ||
and (stored_cache_value.latest_storage_id or 0) | ||
>= (asset_record.asset_entry.last_materialization_storage_id or 0) | ||
and stored_cache_value.partitions_def_id | ||
== partitions_def.get_serializable_unique_identifier(dynamic_partitions_store=self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is clever but pretty gnarly, maybe should be a separate helper function in the partition_status_cache module?
def is_cached_materialized_subset_up_to_date(asset_record: AssetRecord, parittions_def: PartitionsDefinition, dynamic_partitions_store) {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small restructuring suggestion, very sneaky
15e62ec
to
6095a69
Compare
Summary & Motivation
We have a simple an efficient way of avoiding doing work when the "materialize" subset is fully up-to-date in the partition status cache. Because we don't have an ASSET_MATERIALIZATION_FAILED event, the same cannot be said regarding the in-progress subset.
So if you have any in-progress runs targeting an asset
get_and_update_asset_status_cache_value
will always be expensive, even if you only care about the "materialized_susbet" value, which is cheap to calculate. This adds a bit of code to avoid updating the entire asset status cache in cases where the materialized_subset is known to be up to date.How I Tested These Changes