public class AggregateUnpivotRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.aggregateUnpivotRaw(AggregateUnpivotRequest)
.
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.
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,
List<String> columnNames,
String variableColumnName,
String valueColumnName,
List<String> pivotedColumns,
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,
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.
|
List<String> |
getColumnNames() |
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 |
setColumnNames(List<String> columnNames) |
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, List<String> columnNames, 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.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.
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. The default value
is ''.
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. The default
value is ''.
TTL
: Sets the TTL of the table specified in result_table
.
VIEW_ID
: view this result table is part of. The
default value is ''.
MATERIALIZE_ON_GPU
: If true
then the output
columns will be cached on the GPU.
Supported values:
The default value is FALSE
.
CREATE_INDEXES
: Comma-separated list of columns on
which to create indexes on the table specified in result_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 the result_table
option.
Supported values:
The default value is FALSE
.
Map
.public AggregateUnpivotRequest(String tableName, List<String> columnNames, 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.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.
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. The default value
is ''.
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. The default
value is ''.
TTL
: Sets the TTL of the table specified in result_table
.
VIEW_ID
: view this result table is part of. The
default value is ''.
MATERIALIZE_ON_GPU
: If true
then the output
columns will be cached on the GPU.
Supported values:
The default value is FALSE
.
CREATE_INDEXES
: Comma-separated list of columns on
which to create indexes on the table specified in result_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 the result_table
option.
Supported values:
The default value is FALSE
.
Map
.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 List<String> getColumnNames()
public AggregateUnpivotRequest setColumnNames(List<String> columnNames)
columnNames
- List of column names or expressions. A wildcard '*'
can be used to include all the non-pivoted columns
from the source table.this
to mimic the builder pattern.public String getVariableColumnName()
public AggregateUnpivotRequest setVariableColumnName(String variableColumnName)
variableColumnName
- Specifies the variable/parameter column name.
The default value is ''.this
to mimic the builder pattern.public String getValueColumnName()
public AggregateUnpivotRequest setValueColumnName(String valueColumnName)
valueColumnName
- Specifies the value column name. The default
value is ''.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. The default value is ''.
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. The default value is ''.
TTL
:
Sets the TTL of the table specified in result_table
.
VIEW_ID
: view this result table is part of. The default value
is ''.
MATERIALIZE_ON_GPU
: If true
then the output columns
will be cached on the GPU.
Supported values:
The default value is FALSE
.
CREATE_INDEXES
: Comma-separated list of columns on which to
create indexes on the table specified in result_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 the result_table
option.
Supported values:
The default value is FALSE
.
Map
.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. The default value
is ''.
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. The default
value is ''.
TTL
: Sets the TTL of the table specified in result_table
.
VIEW_ID
: view this result table is part of. The
default value is ''.
MATERIALIZE_ON_GPU
: If true
then the output
columns will be cached on the GPU.
Supported values:
The default value is FALSE
.
CREATE_INDEXES
: Comma-separated list of columns on
which to create indexes on the table specified in result_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 the result_table
option.
Supported values:
The default value is FALSE
.
Map
.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 © 2019. All rights reserved.