select_timerange#
Operators to query built-up state.
These operators usually have two inputs, one is a stream of updated data; the other is a “query stream” which contains how to query that data. Downstream will be the result of each query.
Data#
- TC: TypeVar#
Type of secondary
bytewax.operators.windowing.ClockLogic’s state snapshots.
Classes#
- class TimeRangeQuery#
A query to select values in a time range.
- class TimeRangeResult#
-
Results from selecting a time range.
- query: TimeRangeQuery#
- incomplete: bool#
Trueif some values are missing from the query because the operator was configured with too short of a buffer viaselect_timerange.
- class SelectTimeRangeOut#
-
Streams returned from the select time range operator.
- results: KeyedStream[TimeRangeResult[V]]#
Selection results.
- late_ups: KeyedStream[V]#
Upstream items that were deemed late.
- late_queries: KeyedStream[TimeRangeQuery]#
Upstream queries that were deemed late.
Functions#
- time_range_ts_getter(
- query: TimeRangeQuery,
Timestamp getter for the select query stream.
- select_time_range(
- step_id: str,
- up: KeyedStream[V],
- up_clock: Clock[V, Any],
- queries: KeyedStream[TimeRangeQuery],
- query_clock: Clock[TimeRangeQuery, Any],
- max_query_length: timedelta,
Select ranges of buffered timestamped values.
- Parameters:
step_id – Unique ID.
up – Keyed stream of values to buffer.
up_clock – Time definition.
queries – Keyed stream of time ranges to select.
query_clock – This should be an
EventClockwherets_getteristime_range_ts_getter.max_query_length – Buffer size. Incoming queries that request more than this will be missing values from their results and tagged as
TimeRangeResult.incomplete.
- Returns:
A
SelectTimeRangeOutdataclass.