Class AggregateUnpivotRequest
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecordGPUdb.aggregateUnpivot.
Rotate the column values into rows values.
For unpivot details and examples, see Unpivot. For limitations, see Unpivot Limitations.
Unpivot is used to normalize tables that are built for cross tabular reporting purposes. The unpivot operator rotates the column values for all the pivoted columns. A variable column, value column and all columns from the source table except the unpivot columns are projected into the result table. The variable column and value columns in the result table indicate the pivoted column name and values respectively.
The response is returned as a dynamic schema. For details see: dynamic schemas documentation.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA set of string constants for theAggregateUnpivotRequestparameterencoding.static final classA set of string constants for theAggregateUnpivotRequestparameteroptions.Constructor Summary
ConstructorsConstructorDescriptionConstructs an AggregateUnpivotRequest object with default parameters.AggregateUnpivotRequest(String tableName, List<String> columnNames, String variableColumnName, String valueColumnName, List<String> pivotedColumns, String encoding, Map<String, String> options) Constructs an AggregateUnpivotRequest object with the specified parameters.AggregateUnpivotRequest(String tableName, List<String> columnNames, String variableColumnName, String valueColumnName, List<String> pivotedColumns, Map<String, String> options) Constructs an AggregateUnpivotRequest 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.List of column names or expressions.Specifies the encoding for returned records.Optional parameters.List of one or more values typically the column names of the input table.org.apache.avro.SchemaThis method supports the Avro framework and is not intended to be called directly by the user.Name of the table on which the operation will be performed.Specifies the value column name.Specifies the variable/parameter column name.inthashCode()voidThis method supports the Avro framework and is not intended to be called directly by the user.setColumnNames(List<String> columnNames) List of column names or expressions.setEncoding(String encoding) Specifies the encoding for returned records.setOptions(Map<String, String> options) Optional parameters.setPivotedColumns(List<String> pivotedColumns) List of one or more values typically the column names of the input table.setTableName(String tableName) Name of the table on which the operation will be performed.setValueColumnName(String valueColumnName) Specifies the value column name.setVariableColumnName(String variableColumnName) Specifies the variable/parameter column name.toString()
Constructor Details
AggregateUnpivotRequest
public AggregateUnpivotRequest()Constructs an AggregateUnpivotRequest object with default parameters.AggregateUnpivotRequest
public AggregateUnpivotRequest(String tableName, List<String> columnNames, String variableColumnName, String valueColumnName, List<String> pivotedColumns, Map<String, String> options) Constructs an AggregateUnpivotRequest object with the specified parameters.Parameters:tableName- Name of the table on which the operation will be performed. Must be an existing table/view, in [schema_name.]table_name format, using standard name resolution rules.columnNames- List of column names or expressions. A wildcard ’*’ can be used to include all the non-pivoted columns from the source table.variableColumnName- Specifies the variable/parameter column name. The default value is ”.valueColumnName- Specifies the value column name. The default value is ”.pivotedColumns- List of one or more values typically the column names of the input table. All the columns in the source table must have the same data type.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 is non-existent, it will be automatically created.RESULT_TABLE: The name of a 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.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.EXPRESSION: Filter expression to apply to the table prior to unpivot processing.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. ‘timestamp asc, x desc’. The columns specified must be present in input table. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ”.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.LIMIT: The number of records to keep. The default value is ”.TTL: Sets the TTL of the table specified inRESULT_TABLE.VIEW_ID: View this result table is part of. The default value is ”.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the table specified inRESULT_TABLE. The columns specified must be present in output column names. If any alias is given for any column name, the alias must be used, rather than the original column name.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.
Map.AggregateUnpivotRequest
public AggregateUnpivotRequest(String tableName, List<String> columnNames, String variableColumnName, String valueColumnName, List<String> pivotedColumns, String encoding, Map<String, String> options) Constructs an AggregateUnpivotRequest object with the specified parameters.Parameters:tableName- Name of the table on which the operation will be performed. Must be an existing table/view, in [schema_name.]table_name format, using standard name resolution rules.columnNames- List of column names or expressions. A wildcard ’*’ can be used to include all the non-pivoted columns from the source table.variableColumnName- Specifies the variable/parameter column name. The default value is ”.valueColumnName- Specifies the value column name. The default value is ”.pivotedColumns- List of one or more values typically the column names of the input table. All the columns in the source table must have the same data type.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 is non-existent, it will be automatically created.RESULT_TABLE: The name of a 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.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.EXPRESSION: Filter expression to apply to the table prior to unpivot processing.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. ‘timestamp asc, x desc’. The columns specified must be present in input table. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ”.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.LIMIT: The number of records to keep. The default value is ”.TTL: Sets the TTL of the table specified inRESULT_TABLE.VIEW_ID: View this result table is part of. The default value is ”.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the table specified inRESULT_TABLE. The columns specified must be present in output column names. If any alias is given for any column name, the alias must be used, rather than the original column name.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.
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 the table on which the operation will be performed. Must be an existing table/view, in [schema_name.]table_name format, using standard name resolution rules.Returns:The current value oftableName.setTableName
Name of the table on which the operation will be performed. Must be an existing table/view, in [schema_name.]table_name format, using standard name resolution rules.Parameters:tableName- The new value fortableName.Returns:thisto mimic the builder pattern.setColumnNames
List of column names or expressions. A wildcard ’*’ can be used to include all the non-pivoted columns from the source table.Parameters:columnNames- The new value forcolumnNames.Returns:thisto mimic the builder pattern.setVariableColumnName
Specifies the variable/parameter column name. The default value is ”.Parameters:variableColumnName- The new value forvariableColumnName.Returns:thisto mimic the builder pattern.setValueColumnName
Specifies the value column name. The default value is ”.Parameters:valueColumnName- The new value forvalueColumnName.Returns:thisto mimic the builder pattern.setPivotedColumns
List of one or more values typically the column names of the input table. All the columns in the source table must have the same data type.Parameters:pivotedColumns- The new value forpivotedColumns.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 is non-existent, it will be automatically created.RESULT_TABLE: The name of a 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.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.EXPRESSION: Filter expression to apply to the table prior to unpivot processing.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. ‘timestamp asc, x desc’. The columns specified must be present in input table. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ”.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.LIMIT: The number of records to keep. The default value is ”.TTL: Sets the TTL of the table specified inRESULT_TABLE.VIEW_ID: View this result table is part of. The default value is ”.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the table specified inRESULT_TABLE. The columns specified must be present in output column names. If any alias is given for any column name, the alias must be used, rather than the original column name.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.
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 is non-existent, it will be automatically created.RESULT_TABLE: The name of a 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.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.EXPRESSION: Filter expression to apply to the table prior to unpivot processing.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. ‘timestamp asc, x desc’. The columns specified must be present in input table. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ”.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.LIMIT: The number of records to keep. The default value is ”.TTL: Sets the TTL of the table specified inRESULT_TABLE.VIEW_ID: View this result table is part of. The default value is ”.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the table specified inRESULT_TABLE. The columns specified must be present in output column names. If any alias is given for any column name, the alias must be used, rather than the original column name.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.
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: