Class SequenceMovingWindowReduceTransform

    • Constructor Detail

      • SequenceMovingWindowReduceTransform

        public SequenceMovingWindowReduceTransform​(String columnName,
                                                   int lookback,
                                                   ReduceOp op)
        Parameters:
        columnName - Column name to perform windowing on
        lookback - Look back period for windowing
        op - Reduction operation to perform on each window
      • SequenceMovingWindowReduceTransform

        public SequenceMovingWindowReduceTransform​(String columnName,
                                                   String newColumnName,
                                                   int lookback,
                                                   ReduceOp op,
                                                   SequenceMovingWindowReduceTransform.EdgeCaseHandling edgeCaseHandling,
                                                   Writable edgeCaseValue)
        Parameters:
        columnName - Column name to perform windowing on
        newColumnName - Name of the new output column (with results)
        lookback - Look back period for windowing
        op - Reduction operation to perform on each window
        edgeCaseHandling - How the 1st steps should be handled (positions in sequence with indices less then the look-back period)
        edgeCaseValue - Used only with EdgeCaseHandling.SpecifiedValue, maybe null otherwise
    • Method Detail

      • defaultOutputColumnName

        public static String defaultOutputColumnName​(String originalName,
                                                     int lookback,
                                                     ReduceOp op)
      • setInputSchema

        public void setInputSchema​(Schema inputSchema)
        Description copied from interface: ColumnOp
        Set the input schema.
        Specified by:
        setInputSchema in interface ColumnOp
      • getInputSchema

        public Schema getInputSchema()
        Description copied from interface: ColumnOp
        Getter for input schema
        Specified by:
        getInputSchema in interface ColumnOp
        Returns:
      • map

        public List<Writable> map​(List<Writable> writables)
        Description copied from interface: Transform
        Transform a writable in to another writable
        Specified by:
        map in interface Transform
        Parameters:
        writables - the record to transform
        Returns:
        the transformed writable
      • map

        public Object map​(Object input)
        Transform an object in to another object
        Specified by:
        map in interface Transform
        Parameters:
        input - the record to transform
        Returns:
        the transformed writable
      • outputColumnName

        public String outputColumnName()
        The output column name after the operation has been applied
        Specified by:
        outputColumnName in interface ColumnOp
        Returns:
        the output column name
      • outputColumnNames

        public String[] outputColumnNames()
        The output column names This will often be the same as the input
        Specified by:
        outputColumnNames in interface ColumnOp
        Returns:
        the output column names
      • columnNames

        public String[] columnNames()
        Returns column names this op is meant to run on
        Specified by:
        columnNames in interface ColumnOp
        Returns:
      • columnName

        public String columnName()
        Returns a singular column name this op is meant to run on
        Specified by:
        columnName in interface ColumnOp
        Returns: