Class AggregateHistogramRequest

  • All Implemented Interfaces:
    org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

    public class AggregateHistogramRequest
    extends Object
    implements org.apache.avro.generic.IndexedRecord
    A set of parameters for GPUdb.aggregateHistogram.

    Performs a histogram calculation given a table, a column, and an interval function. The interval is used to produce bins of that size and the result, computed over the records falling within each bin, is returned. For each bin, the start value is inclusive, but the end value is exclusive--except for the very last bin for which the end value is also inclusive. The value returned for each bin is the number of records in it, except when a column name is provided as a VALUE_COLUMN. In this latter case the sum of the values corresponding to the VALUE_COLUMN is used as the result instead. The total number of bins requested cannot exceed 10,000.

    NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a VALUE_COLUMN.

    • Constructor Detail

      • AggregateHistogramRequest

        public AggregateHistogramRequest()
        Constructs an AggregateHistogramRequest object with default parameters.
      • AggregateHistogramRequest

        public AggregateHistogramRequest​(String tableName,
                                         String columnName,
                                         double start,
                                         double end,
                                         double interval,
                                         Map<String,​String> options)
        Constructs an AggregateHistogramRequest object with the specified parameters.
        Parameters:
        tableName - Name of the table on which the operation will be performed. Must be an existing table, in [schema_name.]table_name format, using standard name resolution rules.
        columnName - Name of a column or an expression of one or more column names over which the histogram will be calculated.
        start - Lower end value of the histogram interval, inclusive.
        end - Upper end value of the histogram interval, inclusive.
        interval - The size of each bin within the start and end parameters.
        options - Optional parameters.
        • VALUE_COLUMN: The name of the column to use when calculating the bin values (values are summed). The column must be a numerical type (int, double, long, float).
        • START: The start parameter for char types.
        • END: The end parameter for char types.
        • INTERVAL: The interval parameter for char types.
        The default value is an empty Map.
    • Method Detail

      • getClassSchema

        public static org.apache.avro.Schema getClassSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Returns:
        The schema for the class.
      • getTableName

        public String getTableName()
        Name of the table on which the operation will be performed. Must be an existing table, in [schema_name.]table_name format, using standard name resolution rules.
        Returns:
        The current value of tableName.
      • setTableName

        public AggregateHistogramRequest setTableName​(String tableName)
        Name of the table on which the operation will be performed. Must be an existing table, in [schema_name.]table_name format, using standard name resolution rules.
        Parameters:
        tableName - The new value for tableName.
        Returns:
        this to mimic the builder pattern.
      • getColumnName

        public String getColumnName()
        Name of a column or an expression of one or more column names over which the histogram will be calculated.
        Returns:
        The current value of columnName.
      • setColumnName

        public AggregateHistogramRequest setColumnName​(String columnName)
        Name of a column or an expression of one or more column names over which the histogram will be calculated.
        Parameters:
        columnName - The new value for columnName.
        Returns:
        this to mimic the builder pattern.
      • getStart

        public double getStart()
        Lower end value of the histogram interval, inclusive.
        Returns:
        The current value of start.
      • setStart

        public AggregateHistogramRequest setStart​(double start)
        Lower end value of the histogram interval, inclusive.
        Parameters:
        start - The new value for start.
        Returns:
        this to mimic the builder pattern.
      • getEnd

        public double getEnd()
        Upper end value of the histogram interval, inclusive.
        Returns:
        The current value of end.
      • setEnd

        public AggregateHistogramRequest setEnd​(double end)
        Upper end value of the histogram interval, inclusive.
        Parameters:
        end - The new value for end.
        Returns:
        this to mimic the builder pattern.
      • getInterval

        public double getInterval()
        The size of each bin within the start and end parameters.
        Returns:
        The current value of interval.
      • setInterval

        public AggregateHistogramRequest setInterval​(double interval)
        The size of each bin within the start and end parameters.
        Parameters:
        interval - The new value for interval.
        Returns:
        this to mimic the builder pattern.
      • getOptions

        public Map<String,​String> getOptions()
        Optional parameters.
        • VALUE_COLUMN: The name of the column to use when calculating the bin values (values are summed). The column must be a numerical type (int, double, long, float).
        • START: The start parameter for char types.
        • END: The end parameter for char types.
        • INTERVAL: The interval parameter for char types.
        The default value is an empty Map.
        Returns:
        The current value of options.
      • setOptions

        public AggregateHistogramRequest setOptions​(Map<String,​String> options)
        Optional parameters.
        • VALUE_COLUMN: The name of the column to use when calculating the bin values (values are summed). The column must be a numerical type (int, double, long, float).
        • START: The start parameter for char types.
        • END: The end parameter for char types.
        • INTERVAL: The interval parameter for char types.
        The default value is an empty Map.
        Parameters:
        options - The new value for options.
        Returns:
        this to mimic the builder pattern.
      • getSchema

        public org.apache.avro.Schema getSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        getSchema in interface org.apache.avro.generic.GenericContainer
        Returns:
        The schema object describing this class.
      • get

        public Object get​(int index)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        get in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to get
        Returns:
        value of the field with the given index.
        Throws:
        IndexOutOfBoundsException
      • put

        public void put​(int index,
                        Object value)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        put in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to set
        value - the value to set
        Throws:
        IndexOutOfBoundsException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object