Class StringReducer.Builder

    • Constructor Detail

      • Builder

        public Builder​(StringReduceOp defaultOp)
        Create a StringReducer builder, and set the default column reduction operation. For any columns that aren't specified explicitly, they will use the default reduction operation. If a column does have a reduction operation explicitly specified, then it will override the default specified here.
        Parameters:
        defaultOp - Default reduction operation to perform
    • Method Detail

      • appendColumns

        public StringReducer.Builder appendColumns​(String... columns)
        Reduce the specified columns by taking the minimum value
      • prependColumns

        public StringReducer.Builder prependColumns​(String... columns)
        Reduce the specified columns by taking the maximum value
      • mergeColumns

        public StringReducer.Builder mergeColumns​(String... columns)
        Reduce the specified columns by taking the sum of values
      • replaceColumn

        public StringReducer.Builder replaceColumn​(String... columns)
        Reduce the specified columns by taking the mean of the values
      • customReduction

        public StringReducer.Builder customReduction​(String column,
                                                     ColumnReduction columnReduction)
        Reduce the specified column using a custom column reduction functionality.
        Parameters:
        column - Column to execute the custom reduction functionality on
        columnReduction - Column reduction to execute on that column
      • setIgnoreInvalid

        public StringReducer.Builder setIgnoreInvalid​(String... columns)
        When doing the reduction: set the specified columns to ignore any invalid values. Invalid: defined as being not valid according to the ColumnMetaData: ColumnMetaData.isValid(Writable). For numerical columns, this typically means being unable to parse the Writable. For example, Writable.toLong() failing for a Long column. If the column has any restrictions (min/max values, regex for Strings etc) these will also be taken into account.
        Parameters:
        columns - Columns to set 'ignore invalid' for