Repository navigation
Replies: 1 comment
|
@uranusjr, could you take a look at this discussion when you have a moment? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The use case
partition_key=…T10:05:00)Example question from a consumer task:
Why the current model does not express this
AIP-76 rollup (
RollupMapper+Window+WaitPolicy, from #64571 and #66848) works on discrete keys:RollupMapper.to_upstream(downstream_key)lists the exact keys one downstream period needs.source_partition_keyvalues viaWaitPolicy.is_satisfied_by_keys(matched, expected).That fits producers with fixed, aligned partitions. It breaks down for streaming:
AssetEventstorespartition_key(a string),extra, andtimestamp. A key like2025-06-01T10:05:00tells us when the slice starts, not when it ends. The window fills that gap by assuming a fixed unit (one minute forHourWindow).Proposal: let events describe the interval they cover
Each event says which
[start, end)it covers. Completeness becomes interval arithmetic: sort, merge overlaps, and take the complement inside the requested range. That runs in O(n log n) and returns the gaps directly.How an event could carry its interval:
extra{"interval_start": "…T10:05", "interval_end": "…T10:10"}partition_key="2025-06-01T10:05/2025-06-01T10:10"AssetEventcolumnsinterval_start,interval_end(indexed)Where the check could live
A. Task-side sensor / operator (small)
Use the existing Execution API asset-event lookup from a task:
>=,<) on the asset-event endpoints, so ranges are narrowed with a regex. Large ranges need pagination: a month of 5-minute events is about 8,640 rows. The asset must also be declared in the task'sinlets.providers/standard.B. Scheduler-side coverage rollup (large)
Let the scheduler create the downstream Dag run when the period is covered, the way
RollupMapperdoes today for key sets.to_upstream()returns a key setWaitPolicyPartitionedAssetKeyLogsource_partition_keystringMinimumCount(n)B changes the AIP-76 model itself, so it needs community agreement before implementation.
Relationship to the smaller
stepchangeI have opened a separate, much smaller PR (#74594): an optional
steponHourWindow,DayWindow, andWeekWindow, for exampleHourWindow(step=timedelta(minutes=5)). It keeps the key-set model and covers the common case of aligned, fixed-size producers.This coverage idea is complementary. It is for irregular or reprocessed slices, and for consumers who need the gaps as time ranges.
Questions for discussion
[start, end)" a use case others see with partitioned assets, especially for streaming producers?extraconvention, interval keys, or columns?Feedback is welcome, including "this is out of scope for Airflow".
All reactions