Class SlidingTimeWindowAccessStrategy

  • All Implemented Interfaces:
    AccessStrategy

    public class SlidingTimeWindowAccessStrategy
    extends java.lang.Object
    implements AccessStrategy
    Used in UDTF.beforeStart(UDFParameters, UDTFConfigurations).

    When the access strategy of a UDTF is set to an instance of this class, the method UDTF.transform(RowWindow, PointCollector) of the UDTF will be called to transform the original data. You need to override the method in your own UDTF class.

    Sliding time window is a kind of time-based window. To partition the raw query data set into sliding time windows, you need to give the following 4 parameters:

  • display window begin: determines the start time of the first window
  • display window end: if the start time of current window + sliding step > display window end, then current window is the last window that your UDTF can process
  • time interval: determines the time range of a window
  • sliding step: the start time of the next window = the start time of current window + sliding step

    Each call of the method UDTF.transform(RowWindow, PointCollector) processes one time window and can generate any number of data points. Note that the transform method will still be called when there is no data point in a window. Note that the time range of the last few windows may be less than the specified time interval.

    Sample code:

    Style 1:

    {@code
See Also:
UDTF, UDTFConfigurations