aggregateUnique
public AggregateUniqueResponse aggregateUnique(AggregateUniqueRequest request) throws GPUdbException Returns all the unique values from a particular column (specified bycolumnName) of a particular table or view (specified bytableName). IfcolumnNameis a numeric column, the values will be indata. Otherwise ifcolumnNameis a string column, the values will be injsonEncodedResponse. The results can be paged viaoffsetandlimitparameters.“limit”:“10”,“sort_order”:“descending”
The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
If a
RESULT_TABLEname is specified in theoptions, 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 thecolumnName, 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 ofcolumnNameis an unrestricted-length string.Parameters:request-Requestobject containing the parameters for the operation.Returns:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.aggregateUnique
public AggregateUniqueResponse aggregateUnique(String tableName, String columnName, long offset, long limit, Map<String, String> options) throws GPUdbException Returns all the unique values from a particular column (specified bycolumnName) of a particular table or view (specified bytableName). IfcolumnNameis a numeric column, the values will be indata. Otherwise ifcolumnNameis a string column, the values will be injsonEncodedResponse. The results can be paged viaoffsetandlimitparameters.“limit”:“10”,“sort_order”:“descending”
The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
If a
RESULT_TABLEname is specified in theoptions, 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 thecolumnName, 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 ofcolumnNameis an unrestricted-length string.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 usecreateSchemato 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:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.