Loading section...

Merging Intervals with Metadata

Concepts: pyIntervalMetadata, pyAggregationSemantics, pyLogWindowMerge

In production, intervals are never just [start, end]. They carry data: error counts for a time window, user IDs in a session, labels from an anomaly detector. When you merge overlapping intervals, you must also merge their payloads. How you merge the payload depends on what it represents: sums for counts, unions for label sets, weighted averages for metrics. This is where the algorithm meets real data engineering — and it is what makes interval merging a non-trivial production problem. Merging Log Windows with Error Counts The structure is identical to basic merge intervals. The only difference is what happens when an overlap is detected: instead of just updating the end, you also aggregate the payload. Sum error counts (additive metric). Union error type sets (set-valued label). Union sou