Class AggregateUniqueRequest
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecordGPUdb.aggregateUnique.
Returns all the unique values from a particular column (specified by columnName) of a particular table or view (specified by tableName). If columnName is a numeric column, the values will be in data. Otherwise if columnName is a string column, the values will be in jsonEncodedResponse. The results can be paged via offset and limit parameters.
“limit”:“10”,“sort_order”:“descending”
The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
If a RESULT_TABLE name is specified in the options, the results are stored in a new table with that name—no results are returned in the response. Both the table name and resulting column name must adhere to standard naming conventions; any column expression will need to be aliased. If the source table’s shard key is used as the columnName, the result table will be sharded, in all other cases it will be replicated. Sorting will properly function only if the result table is replicated or if there is only one processing node and should not be relied upon in other cases. Not available if the value of columnName is an unrestricted-length string.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA set of string constants for theAggregateUniqueRequestparameterencoding.static final classA set of string constants for theAggregateUniqueRequestparameteroptions.Constructor Summary
ConstructorsConstructorDescriptionConstructs an AggregateUniqueRequest object with default parameters.AggregateUniqueRequest(String tableName, String columnName, long offset, long limit, String encoding, Map<String, String> options) Constructs an AggregateUniqueRequest object with the specified parameters.AggregateUniqueRequest(String tableName, String columnName, long offset, long limit, Map<String, String> options) Constructs an AggregateUniqueRequest object with the specified parameters.Method Summary
Modifier and TypeMethodDescriptionbooleanget(int index) This method supports the Avro framework and is not intended to be called directly by the user.static org.apache.avro.SchemaThis method supports the Avro framework and is not intended to be called directly by the user.Name of the column or an expression containing one or more column names on which the unique function would be applied.Specifies the encoding for returned records.longgetLimit()A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned.longA positive integer indicating the number of initial results to skip (this can be useful for paging through the results).Optional parameters.org.apache.avro.SchemaThis method supports the Avro framework and is not intended to be called directly by the user.Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.inthashCode()voidThis method supports the Avro framework and is not intended to be called directly by the user.setColumnName(String columnName) Name of the column or an expression containing one or more column names on which the unique function would be applied.setEncoding(String encoding) Specifies the encoding for returned records.setLimit(long limit) A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned.setOffset(long offset) A positive integer indicating the number of initial results to skip (this can be useful for paging through the results).setOptions(Map<String, String> options) Optional parameters.setTableName(String tableName) Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.toString()
Constructor Details
AggregateUniqueRequest
public AggregateUniqueRequest()Constructs an AggregateUniqueRequest object with default parameters.AggregateUniqueRequest
public AggregateUniqueRequest(String tableName, String columnName, long offset, long limit, Map<String, String> options) Constructs an AggregateUniqueRequest object with the specified parameters.Parameters:tableName- Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.columnName- Name of the column or an expression containing one or more column names on which the unique function would be applied.offset- A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.limit- A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the max_get_records_size parameter in the server configuration. UsehasMoreRecordsto see if more records exist in the result to be fetched, andoffsetandlimitto request subsequent pages of results. The default value is -9999.options- Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofRESULT_TABLE. IfRESULT_TABLE_PERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_RESULT_TABLE_NAME. Supported values:The default value isFALSE.COLLECTION_NAME: [DEPRECATED—please specify the containing schema as part ofRESULT_TABLEand useGPUdb.createSchemato create the schema if non-existent] Name of a schema which is to contain the table specified inRESULT_TABLE. If the schema provided is non-existent, it will be automatically created.EXPRESSION: Filter expression to apply to the table.SORT_ORDER: String indicating how the returned values should be sorted. Supported values:The default value isASCENDING.ORDER_BY: Comma-separated list of the columns to be sorted by as well as the sort direction, e.g., ‘timestamp asc, x desc’. The default value is ”.RESULT_TABLE: The name of the table used to store the results, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If present, no results are returned in the response. Not available ifcolumnNameis an unrestricted-length string.RESULT_TABLE_PERSIST: IfTRUE, then the result table specified inRESULT_TABLEwill be persisted and will not expire unless aTTLis specified. IfFALSE, then the result table will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values:The default value isFALSE.RESULT_TABLE_FORCE_REPLICATED: Force the result table to be replicated (ignores any sharding). Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.RESULT_TABLE_GENERATE_PK: IfTRUEthen set a primary key for the result table. Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.TTL: Sets the TTL of the table specified inRESULT_TABLE.CHUNK_SIZE: Indicates the number of records per chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.COMPRESSION_CODEC: The default compression codec for the result table’s columns.VIEW_ID: ID of view of which the result table will be a member. The default value is ”.
Map.AggregateUniqueRequest
public AggregateUniqueRequest(String tableName, String columnName, long offset, long limit, String encoding, Map<String, String> options) Constructs an AggregateUniqueRequest object with the specified parameters.Parameters:tableName- Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.columnName- Name of the column or an expression containing one or more column names on which the unique function would be applied.offset- A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.limit- A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the max_get_records_size parameter in the server configuration. UsehasMoreRecordsto see if more records exist in the result to be fetched, andoffsetandlimitto request subsequent pages of results. The default value is -9999.encoding- Specifies the encoding for returned records. Supported values:BINARY: Indicates that the returned records should be binary encoded.JSON: Indicates that the returned records should be JSON-encoded.
BINARY.options- Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofRESULT_TABLE. IfRESULT_TABLE_PERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_RESULT_TABLE_NAME. Supported values:The default value isFALSE.COLLECTION_NAME: [DEPRECATED—please specify the containing schema as part ofRESULT_TABLEand useGPUdb.createSchemato create the schema if non-existent] Name of a schema which is to contain the table specified inRESULT_TABLE. If the schema provided is non-existent, it will be automatically created.EXPRESSION: Filter expression to apply to the table.SORT_ORDER: String indicating how the returned values should be sorted. Supported values:The default value isASCENDING.ORDER_BY: Comma-separated list of the columns to be sorted by as well as the sort direction, e.g., ‘timestamp asc, x desc’. The default value is ”.RESULT_TABLE: The name of the table used to store the results, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If present, no results are returned in the response. Not available ifcolumnNameis an unrestricted-length string.RESULT_TABLE_PERSIST: IfTRUE, then the result table specified inRESULT_TABLEwill be persisted and will not expire unless aTTLis specified. IfFALSE, then the result table will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values:The default value isFALSE.RESULT_TABLE_FORCE_REPLICATED: Force the result table to be replicated (ignores any sharding). Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.RESULT_TABLE_GENERATE_PK: IfTRUEthen set a primary key for the result table. Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.TTL: Sets the TTL of the table specified inRESULT_TABLE.CHUNK_SIZE: Indicates the number of records per chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.COMPRESSION_CODEC: The default compression codec for the result table’s columns.VIEW_ID: ID of view of which the result table will be a member. The default value is ”.
Map.
Method Details
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
Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.Returns:The current value oftableName.setTableName
Name of an existing table or view on which the operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.Parameters:tableName- The new value fortableName.Returns:thisto mimic the builder pattern.setColumnName
Name of the column or an expression containing one or more column names on which the unique function would be applied.Parameters:columnName- The new value forcolumnName.Returns:thisto mimic the builder pattern.getOffset
public long getOffset()A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.Returns:The current value ofoffset.setOffset
A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.Parameters:offset- The new value foroffset.Returns:thisto mimic the builder pattern.getLimit
public long getLimit()A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the max_get_records_size parameter in the server configuration. UsehasMoreRecordsto see if more records exist in the result to be fetched, andoffsetandlimitto request subsequent pages of results. The default value is -9999.Returns:The current value oflimit.setLimit
A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the max_get_records_size parameter in the server configuration. UsehasMoreRecordsto see if more records exist in the result to be fetched, andoffsetandlimitto request subsequent pages of results. The default value is -9999.Parameters:limit- The new value forlimit.Returns:thisto mimic the builder pattern.setEncoding
Specifies the encoding for returned records. Supported values:BINARY: Indicates that the returned records should be binary encoded.JSON: Indicates that the returned records should be JSON-encoded.
BINARY.Parameters:encoding- The new value forencoding.Returns:thisto mimic the builder pattern.getOptions
Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofRESULT_TABLE. IfRESULT_TABLE_PERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_RESULT_TABLE_NAME. Supported values:The default value isFALSE.COLLECTION_NAME: [DEPRECATED—please specify the containing schema as part ofRESULT_TABLEand useGPUdb.createSchemato create the schema if non-existent] Name of a schema which is to contain the table specified inRESULT_TABLE. If the schema provided is non-existent, it will be automatically created.EXPRESSION: Filter expression to apply to the table.SORT_ORDER: String indicating how the returned values should be sorted. Supported values:The default value isASCENDING.ORDER_BY: Comma-separated list of the columns to be sorted by as well as the sort direction, e.g., ‘timestamp asc, x desc’. The default value is ”.RESULT_TABLE: The name of the table used to store the results, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If present, no results are returned in the response. Not available ifcolumnNameis an unrestricted-length string.RESULT_TABLE_PERSIST: IfTRUE, then the result table specified inRESULT_TABLEwill be persisted and will not expire unless aTTLis specified. IfFALSE, then the result table will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values:The default value isFALSE.RESULT_TABLE_FORCE_REPLICATED: Force the result table to be replicated (ignores any sharding). Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.RESULT_TABLE_GENERATE_PK: IfTRUEthen set a primary key for the result table. Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.TTL: Sets the TTL of the table specified inRESULT_TABLE.CHUNK_SIZE: Indicates the number of records per chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.COMPRESSION_CODEC: The default compression codec for the result table’s columns.VIEW_ID: ID of view of which the result table will be a member. The default value is ”.
Map.Returns:The current value ofoptions.setOptions
Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofRESULT_TABLE. IfRESULT_TABLE_PERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_RESULT_TABLE_NAME. Supported values:The default value isFALSE.COLLECTION_NAME: [DEPRECATED—please specify the containing schema as part ofRESULT_TABLEand useGPUdb.createSchemato create the schema if non-existent] Name of a schema which is to contain the table specified inRESULT_TABLE. If the schema provided is non-existent, it will be automatically created.EXPRESSION: Filter expression to apply to the table.SORT_ORDER: String indicating how the returned values should be sorted. Supported values:The default value isASCENDING.ORDER_BY: Comma-separated list of the columns to be sorted by as well as the sort direction, e.g., ‘timestamp asc, x desc’. The default value is ”.RESULT_TABLE: The name of the table used to store the results, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If present, no results are returned in the response. Not available ifcolumnNameis an unrestricted-length string.RESULT_TABLE_PERSIST: IfTRUE, then the result table specified inRESULT_TABLEwill be persisted and will not expire unless aTTLis specified. IfFALSE, then the result table will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values:The default value isFALSE.RESULT_TABLE_FORCE_REPLICATED: Force the result table to be replicated (ignores any sharding). Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.RESULT_TABLE_GENERATE_PK: IfTRUEthen set a primary key for the result table. Must be used in combination with theRESULT_TABLEoption. Supported values:The default value isFALSE.TTL: Sets the TTL of the table specified inRESULT_TABLE.CHUNK_SIZE: Indicates the number of records per chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for the result table. Must be used in combination with theRESULT_TABLEoption.COMPRESSION_CODEC: The default compression codec for the result table’s columns.VIEW_ID: ID of view of which the result table will be a member. The default value is ”.
Map.Parameters:options- The new value foroptions.Returns:thisto 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:getSchemain interfaceorg.apache.avro.generic.GenericContainerReturns:The schema object describing this class.get
This method supports the Avro framework and is not intended to be called directly by the user.Specified by:getin interfaceorg.apache.avro.generic.IndexedRecordParameters:index- the position of the field to getReturns:value of the field with the given index.Throws:put
This method supports the Avro framework and is not intended to be called directly by the user.Specified by:putin interfaceorg.apache.avro.generic.IndexedRecordParameters:index- the position of the field to setvalue- the value to setThrows: