public class CreateUnionRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createUnion(CreateUnionRequest)
.
Performs a union (concatenation) of one or more existing tables or views, the results of which are stored in a new view. It is equivalent to the SQL UNION ALL operator. Non-charN 'string' and 'bytes' column types cannot be included in a union, neither can columns with the property 'store_only'. Though not explicitly unions, intersect and except are also available from this endpoint.
Modifier and Type | Class and Description |
---|---|
static class |
CreateUnionRequest.Options
Optional parameters.
|
Constructor and Description |
---|
CreateUnionRequest()
Constructs a CreateUnionRequest object with default parameters.
|
CreateUnionRequest(String tableName,
List<String> tableNames,
List<List<String>> inputColumnNames,
List<String> outputColumnNames,
Map<String,String> options)
Constructs a CreateUnionRequest 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<List<String>> |
getInputColumnNames() |
Map<String,String> |
getOptions() |
List<String> |
getOutputColumnNames() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getTableName() |
List<String> |
getTableNames() |
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.
|
CreateUnionRequest |
setInputColumnNames(List<List<String>> inputColumnNames) |
CreateUnionRequest |
setOptions(Map<String,String> options) |
CreateUnionRequest |
setOutputColumnNames(List<String> outputColumnNames) |
CreateUnionRequest |
setTableName(String tableName) |
CreateUnionRequest |
setTableNames(List<String> tableNames) |
String |
toString() |
public CreateUnionRequest()
public CreateUnionRequest(String tableName, List<String> tableNames, List<List<String>> inputColumnNames, List<String> outputColumnNames, Map<String,String> options)
tableName
- Name of the table to be created. Has the same naming
restrictions as tables.tableNames
- The list of table names making up the union. Must
contain the names of one or more existing tables.inputColumnNames
- The list of columns from each of the
corresponding input tables.outputColumnNames
- The list of names of the columns to be stored
in the union.options
- Optional parameters.
COLLECTION_NAME
: Name of a collection which is to
contain the union. If the collection provided is
non-existent, the collection will be automatically
created. If empty, then the union will be a top-level
table.
MATERIALIZE_ON_GPU
: If 'true' then the columns of the
union will be cached on the GPU.
Supported values:
The default value is FALSE
.
MODE
: If 'merge_views' then this operation will merge
(i.e. union) the provided views. All 'table_names' must
be views from the same underlying base table.
Supported values:
UNION_ALL
: Retains all rows from the specified tables.
UNION
: Retains all unique rows from the specified
tables (synonym for 'union_distinct').
UNION_DISTINCT
: Retains all unique rows from the
specified tables.
EXCEPT
: Retains all unique rows from the first table
that do not appear in the second table (only works on 2
tables).
INTERSECT
: Retains all unique rows that appear in both
of the specified tables (only works on 2 tables).
MERGE_VIEWS
: Merge two or more views (or views of
views) of the same base data set into a new view. The
resulting view would match the results of a SQL OR
operation, e.g., if filter 1 creates a view using the
expression 'x = 10' and filter 2 creates a view using
the expression 'x <= 10', then the merge views operation
creates a new view using the expression 'x = 10 OR x <=
10'.
UNION_ALL
.
TTL
:
Sets the TTL of the table specified in tableName
. The value must be the desired TTL in
minutes.
PERSIST
: If true
then the union will be
persisted as a regular table (it will not be
automatically cleared unless a ttl
is provided,
and the table data can be modified in subsequent
operations). If false
then the union will be a
read-only, memory-only temporary table.
Supported values:
The default value is FALSE
.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public CreateUnionRequest setTableName(String tableName)
tableName
- Name of the table to be created. Has the same naming
restrictions as tables.this
to mimic the builder pattern.public List<String> getTableNames()
public CreateUnionRequest setTableNames(List<String> tableNames)
tableNames
- The list of table names making up the union. Must
contain the names of one or more existing tables.this
to mimic the builder pattern.public List<List<String>> getInputColumnNames()
public CreateUnionRequest setInputColumnNames(List<List<String>> inputColumnNames)
inputColumnNames
- The list of columns from each of the
corresponding input tables.this
to mimic the builder pattern.public List<String> getOutputColumnNames()
public CreateUnionRequest setOutputColumnNames(List<String> outputColumnNames)
outputColumnNames
- The list of names of the columns to be stored
in the union.this
to mimic the builder pattern.public Map<String,String> getOptions()
COLLECTION_NAME
: Name of a collection which is to contain the
union. If the collection provided is non-existent, the
collection will be automatically created. If empty, then the
union will be a top-level table.
MATERIALIZE_ON_GPU
: If 'true' then the columns of the union
will be cached on the GPU.
Supported values:
The default value is FALSE
.
MODE
: If
'merge_views' then this operation will merge (i.e. union) the
provided views. All 'table_names' must be views from the same
underlying base table.
Supported values:
UNION_ALL
: Retains all rows from the specified tables.
UNION
:
Retains all unique rows from the specified tables (synonym for
'union_distinct').
UNION_DISTINCT
: Retains all unique rows from the specified
tables.
EXCEPT
:
Retains all unique rows from the first table that do not appear
in the second table (only works on 2 tables).
INTERSECT
: Retains all unique rows that appear in both of the
specified tables (only works on 2 tables).
MERGE_VIEWS
: Merge two or more views (or views of views) of the
same base data set into a new view. The resulting view would
match the results of a SQL OR operation, e.g., if filter 1
creates a view using the expression 'x = 10' and filter 2
creates a view using the expression 'x <= 10', then the merge
views operation creates a new view using the expression 'x = 10
OR x <= 10'.
UNION_ALL
.
TTL
: Sets the
TTL of the table specified in tableName
. The value must
be the desired TTL in minutes.
PERSIST
:
If true
then the union will be persisted as a regular
table (it will not be automatically cleared unless a ttl
is provided, and the table data can be modified in subsequent
operations). If false
then the union will be a
read-only, memory-only temporary table.
Supported values:
The default value is FALSE
.
public CreateUnionRequest setOptions(Map<String,String> options)
options
- Optional parameters.
COLLECTION_NAME
: Name of a collection which is to
contain the union. If the collection provided is
non-existent, the collection will be automatically
created. If empty, then the union will be a top-level
table.
MATERIALIZE_ON_GPU
: If 'true' then the columns of the
union will be cached on the GPU.
Supported values:
The default value is FALSE
.
MODE
: If 'merge_views' then this operation will merge
(i.e. union) the provided views. All 'table_names' must
be views from the same underlying base table.
Supported values:
UNION_ALL
: Retains all rows from the specified tables.
UNION
: Retains all unique rows from the specified
tables (synonym for 'union_distinct').
UNION_DISTINCT
: Retains all unique rows from the
specified tables.
EXCEPT
: Retains all unique rows from the first table
that do not appear in the second table (only works on 2
tables).
INTERSECT
: Retains all unique rows that appear in both
of the specified tables (only works on 2 tables).
MERGE_VIEWS
: Merge two or more views (or views of
views) of the same base data set into a new view. The
resulting view would match the results of a SQL OR
operation, e.g., if filter 1 creates a view using the
expression 'x = 10' and filter 2 creates a view using
the expression 'x <= 10', then the merge views operation
creates a new view using the expression 'x = 10 OR x <=
10'.
UNION_ALL
.
TTL
:
Sets the TTL of the table specified in tableName
. The value must be the desired TTL in
minutes.
PERSIST
: If true
then the union will be
persisted as a regular table (it will not be
automatically cleared unless a ttl
is provided,
and the table data can be modified in subsequent
operations). If false
then the union will be a
read-only, memory-only temporary table.
Supported values:
The default value is FALSE
.
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 © 2017. All rights reserved.