Closed markheger closed 3 years ago
Workaround is using rstring
in structured schema.
agg_schema = StreamSchema('tuple<uint64 sum, rstring paneTiming>').as_tuple(named=True)
# timeInterval window
win = s.time_interval(interval_duration=5.0, discard_age=30.0)
agg = op.Map('spl.relational::Aggregate', win, schema=agg_schema)
agg.sum = agg.output('Sum((uint64)num)')
agg.paneTiming = agg.output('(rstring)paneTiming()')
In SPL the Sys.PaneTiming is used with event-time
TimeInterval
windows.Following function could be used in output attribute assignments:
The type
Sys.PaneTiming
is a valid attribute type in a defined SPL schema:Python StreamSchema
In Python topology the following error is raised when StreamSchema is like this:
StreamSchema('tuple<Sys.PaneTiming pt>')
SPL definition
Sys.PaneTiming = enum { paneEarly, paneOnComplete, paneLate };
The timing of a window pane triggering in relation to the enclosing operator's watermark that is used for predicting pane completion.
paneEarly
: The system has not yet predicted that it has seen all data which may contribute to a pane's window.paneOnComplete
: The system predicts that it has seen all data which may contribute to a pane's window.paneLate
: The system encountered new data for a pane's window after predicting no more could arrive.