public class AggregateUnpivotRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.aggregateUnpivotRaw(AggregateUnpivotRequest)
.
Rotate the column values into rows values.
The aggregate 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.
Modifier and Type | Class and Description |
---|---|
static class |
AggregateUnpivotRequest.Encoding
Specifies the encoding for returned records.
|
static class |
AggregateUnpivotRequest.Options
Optional parameters.
|
Constructor and Description |
---|
AggregateUnpivotRequest()
Constructs an AggregateUnpivotRequest object with default parameters.
|
AggregateUnpivotRequest(String tableName,
String variableColumnName,
String valueColumnName,
List<String> pivotedColumns,
Map<String,String> options)
Constructs an AggregateUnpivotRequest object with the specified
parameters.
|
AggregateUnpivotRequest(String tableName,
String variableColumnName,
String valueColumnName,
List<String> pivotedColumns,
String encoding,
Map<String,String> options)
Constructs an AggregateUnpivotRequest object with the specified
parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getEncoding() |
Map<String,String> |
getOptions() |
List<String> |
getPivotedColumns() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getTableName() |
String |
getValueColumnName() |
String |
getVariableColumnName() |
int |
hashCode() |
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
AggregateUnpivotRequest |
setEncoding(String encoding) |
AggregateUnpivotRequest |
setOptions(Map<String,String> options) |
AggregateUnpivotRequest |
setPivotedColumns(List<String> pivotedColumns) |
AggregateUnpivotRequest |
setTableName(String tableName) |
AggregateUnpivotRequest |
setValueColumnName(String valueColumnName) |
AggregateUnpivotRequest |
setVariableColumnName(String variableColumnName) |
String |
toString() |
public AggregateUnpivotRequest()
public AggregateUnpivotRequest(String tableName, String variableColumnName, String valueColumnName, List<String> pivotedColumns, Map<String,String> options)
tableName
- Name of the table on which the operation will be
performed. Must be an existing table/view.variableColumnName
- Specifies the variable/parameter column name.valueColumnName
- Specifies the value column name.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.
COLLECTION_NAME
: Name of a collection which is to
contain the table specified in result_table
. If
the collection provided is non-existent, the collection
will be automatically created. If empty, then the table
will be a top-level table.
RESULT_TABLE
: The name of the table used to store the
results. Has the same naming restrictions as tables. If present, no results are
returned in the response.
RESULT_TABLE_PERSIST
: If true
, then the result
table specified in result_table
will be
persisted and will not expire unless a ttl
is
specified. If false
, then the result table
will be an in-memory table and will expire unless a
ttl
is specified otherwise.
Supported values:
The default value is FALSE
.
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.
CHUNK_SIZE
: Indicates the chunk size to be used for the
result table. Must be used in combination with the
result_table
option.
LIMIT
: The number of records to keep.
TTL
: Sets the TTL of the table specified in result_table
.
public AggregateUnpivotRequest(String tableName, String variableColumnName, String valueColumnName, List<String> pivotedColumns, String encoding, Map<String,String> options)
tableName
- Name of the table on which the operation will be
performed. Must be an existing table/view.variableColumnName
- Specifies the variable/parameter column name.valueColumnName
- Specifies the value column name.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.
COLLECTION_NAME
: Name of a collection which is to
contain the table specified in result_table
. If
the collection provided is non-existent, the collection
will be automatically created. If empty, then the table
will be a top-level table.
RESULT_TABLE
: The name of the table used to store the
results. Has the same naming restrictions as tables. If present, no results are
returned in the response.
RESULT_TABLE_PERSIST
: If true
, then the result
table specified in result_table
will be
persisted and will not expire unless a ttl
is
specified. If false
, then the result table
will be an in-memory table and will expire unless a
ttl
is specified otherwise.
Supported values:
The default value is FALSE
.
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.
CHUNK_SIZE
: Indicates the chunk size to be used for the
result table. Must be used in combination with the
result_table
option.
LIMIT
: The number of records to keep.
TTL
: Sets the TTL of the table specified in result_table
.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public AggregateUnpivotRequest setTableName(String tableName)
tableName
- Name of the table on which the operation will be
performed. Must be an existing table/view.this
to mimic the builder pattern.public String getVariableColumnName()
public AggregateUnpivotRequest setVariableColumnName(String variableColumnName)
variableColumnName
- Specifies the variable/parameter column name.this
to mimic the builder pattern.public String getValueColumnName()
public AggregateUnpivotRequest setValueColumnName(String valueColumnName)
valueColumnName
- Specifies the value column name.this
to mimic the builder pattern.public List<String> getPivotedColumns()
public AggregateUnpivotRequest setPivotedColumns(List<String> pivotedColumns)
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.this
to mimic the builder pattern.public String getEncoding()
public AggregateUnpivotRequest setEncoding(String encoding)
public Map<String,String> getOptions()
COLLECTION_NAME
: Name of a collection which is to contain the
table specified in result_table
. If the collection
provided is non-existent, the collection will be automatically
created. If empty, then the table will be a top-level table.
RESULT_TABLE
: The name of the table used to store the results.
Has the same naming restrictions as tables. If present, no results are returned in
the response.
RESULT_TABLE_PERSIST
: If true
, then the result table
specified in result_table
will be persisted and will not
expire unless a ttl
is specified. If false
,
then the result table will be an in-memory table and will expire
unless a ttl
is specified otherwise.
Supported values:
The default value is FALSE
.
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.
CHUNK_SIZE
: Indicates the chunk size to be used for the result
table. Must be used in combination with the result_table
option.
LIMIT
:
The number of records to keep.
TTL
:
Sets the TTL of the table specified in result_table
.
public AggregateUnpivotRequest setOptions(Map<String,String> options)
options
- Optional parameters.
COLLECTION_NAME
: Name of a collection which is to
contain the table specified in result_table
. If
the collection provided is non-existent, the collection
will be automatically created. If empty, then the table
will be a top-level table.
RESULT_TABLE
: The name of the table used to store the
results. Has the same naming restrictions as tables. If present, no results are
returned in the response.
RESULT_TABLE_PERSIST
: If true
, then the result
table specified in result_table
will be
persisted and will not expire unless a ttl
is
specified. If false
, then the result table
will be an in-memory table and will expire unless a
ttl
is specified otherwise.
Supported values:
The default value is FALSE
.
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.
CHUNK_SIZE
: Indicates the chunk size to be used for the
result table. Must be used in combination with the
result_table
option.
LIMIT
: The number of records to keep.
TTL
: Sets the TTL of the table specified in result_table
.
this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2018. All rights reserved.