Class OverlappingTimeWindowFunction

    • Constructor Detail

      • OverlappingTimeWindowFunction

        public OverlappingTimeWindowFunction​(String timeColumn,
                                             long windowSize,
                                             TimeUnit windowSizeUnit,
                                             long windowSeparation,
                                             TimeUnit windowSeparationUnit)
        Constructor with zero offset
        Parameters:
        timeColumn - Name of the column that contains the time values (must be a time column)
        windowSize - Numerical quantity for the size of the time window (used in conjunction with windowSizeUnit)
        windowSizeUnit - Unit of the time window
        windowSeparation - The separation between consecutive window start times (used in conjunction with WindowSeparationUnit)
        windowSeparationUnit - Unit for the separation between windows
      • OverlappingTimeWindowFunction

        public OverlappingTimeWindowFunction​(String timeColumn,
                                             long windowSize,
                                             TimeUnit windowSizeUnit,
                                             long windowSeparation,
                                             TimeUnit windowSeparationUnit,
                                             boolean addWindowStartTimeColumn,
                                             boolean addWindowEndTimeColumn)
        Constructor with zero offset, ability to add window start/end time columns
        Parameters:
        timeColumn - Name of the column that contains the time values (must be a time column)
        windowSize - Numerical quantity for the size of the time window (used in conjunction with windowSizeUnit)
        windowSizeUnit - Unit of the time window
        windowSeparation - The separation between consecutive window start times (used in conjunction with WindowSeparationUnit)
        windowSeparationUnit - Unit for the separation between windows
      • OverlappingTimeWindowFunction

        public OverlappingTimeWindowFunction​(String timeColumn,
                                             long windowSize,
                                             TimeUnit windowSizeUnit,
                                             long windowSeparation,
                                             TimeUnit windowSeparationUnit,
                                             long offset,
                                             TimeUnit offsetUnit)
        Constructor with optional offset
        Parameters:
        timeColumn - Name of the column that contains the time values (must be a time column)
        windowSize - Numerical quantity for the size of the time window (used in conjunction with windowSizeUnit)
        windowSizeUnit - Unit of the time window
        windowSeparation - The separation between consecutive window start times (used in conjunction with WindowSeparationUnit)
        windowSeparationUnit - Unit for the separation between windows
        offset - Optional offset amount, to shift start/end of the time window forward or back
        offsetUnit - Optional offset unit for the offset amount.
      • OverlappingTimeWindowFunction

        public OverlappingTimeWindowFunction​(String timeColumn,
                                             long windowSize,
                                             TimeUnit windowSizeUnit,
                                             long windowSeparation,
                                             TimeUnit windowSeparationUnit,
                                             long offset,
                                             TimeUnit offsetUnit,
                                             boolean addWindowStartTimeColumn,
                                             boolean addWindowEndTimeColumn,
                                             boolean excludeEmptyWindows)
        Constructor with optional offset, ability to add window start/end time columns
        Parameters:
        timeColumn - Name of the column that contains the time values (must be a time column)
        windowSize - Numerical quantity for the size of the time window (used in conjunction with windowSizeUnit)
        windowSizeUnit - Unit of the time window
        windowSeparation - The separation between consecutive window start times (used in conjunction with WindowSeparationUnit)
        windowSeparationUnit - Unit for the separation between windows
        offset - Optional offset amount, to shift start/end of the time window forward or back
        offsetUnit - Optional offset unit for the offset amount.
        addWindowStartTimeColumn - If true: add a time column (name: "windowStartTime") that contains the start time of the window
        addWindowEndTimeColumn - If true: add a time column (name: "windowEndTime") that contains the end time of the window
        excludeEmptyWindows - If true: exclude any windows that don't have any values in them
    • Method Detail

      • transform

        public Schema transform​(Schema inputSchema)
        Description copied from interface: WindowFunction
        Get the output schema, given the input schema. Typically the output schema is the same as the input schema, but not necessarily (for example, if the window function adds columns for the window start/end times)
        Specified by:
        transform in interface WindowFunction
        Parameters:
        inputSchema - Schema of the input data
        Returns:
        Schema of the output windows