public class CreateUnionRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createUnion(CreateUnionRequest)
.
Merges data from one or more tables with comparable data types into a new table.
The following merges are supported:
UNION (DISTINCT/ALL) - For data set union details and examples, see Union. For limitations, see Union Limitations and Cautions.
INTERSECT (DISTINCT/ALL) - For data set intersection details and examples, see Intersect. For limitations, see Intersect Limitations.
EXCEPT (DISTINCT/ALL) - For data set subtraction details and examples, see Except. For limitations, see Except Limitations.
MERGE VIEWS - For a given set of filtered views on a single table, creates a single filtered view containing all of the unique records across all of the given filtered data sets.
Non-charN 'string' and 'bytes' column types cannot be merged, nor can columns marked as store-only.
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, in
[schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.tableNames
- The list of table names to merge, in
[schema_name.]table_name format, using standard name resolution rules. 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 output table.options
- Optional parameters.
CREATE_TEMP_TABLE
: If true
, a unique temporary
table name will be generated in the sys_temp schema and
used in place of tableName
. If persist
is false
(or unspecified), then this is always
allowed even if the caller does not have permission to
create tables. The generated name is returned in qualified_table_name
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
: [DEPRECATED--please specify the
containing schema for the projection as part of tableName
and use GPUdb.createSchema(CreateSchemaRequest)
to
create the schema if non-existent] Name of the schema
for the output table. If the schema provided is
non-existent, it will be automatically created. The
default value is ''.
MODE
: If merge_views
, then this operation will
merge the provided views. All tableNames
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).
EXCEPT_ALL
: Retains all rows(including duplicates) 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).
INTERSECT_ALL
: Retains all rows(including duplicates)
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. If
this mode is selected inputColumnNames
AND
outputColumnNames
must be empty. The resulting
view would match the results of a SQL OR operation,
e.g., if filter 1 creates a view using the expression 'x
= 20' and filter 2 creates a view using the expression
'x <= 10', then the merge views operation creates a new
view using the expression 'x = 20 OR x <= 10'.
UNION_ALL
.
CHUNK_SIZE
: Indicates the number of records per chunk
to be used for this output table.
CREATE_INDEXES
: Comma-separated list of columns on
which to create indexes on the output table. The
columns specified must be present in outputColumnNames
.
TTL
:
Sets the TTL of the output table specified in
tableName
.
PERSIST
: If true
, then the output table
specified in tableName
will be persisted and
will not expire unless a ttl
is specified. If
false
, then the output table will be an
in-memory table and will expire unless a ttl
is
specified otherwise.
Supported values:
The default value is FALSE
.
VIEW_ID
: ID of view of which this output table is a
member. The default value is ''.
FORCE_REPLICATED
: If true
, then the output
table specified in tableName
will be replicated
even if the source tables are not.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table and its
columns.
Map
.public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public CreateUnionRequest setTableName(String tableName)
tableName
- Name of the table to be created, in
[schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.this
to mimic the builder pattern.public List<String> getTableNames()
public CreateUnionRequest setTableNames(List<String> tableNames)
tableNames
- The list of table names to merge, in
[schema_name.]table_name format, using standard name resolution rules. 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 output table.this
to mimic the builder pattern.public Map<String,String> getOptions()
CREATE_TEMP_TABLE
: If true
, a unique temporary table
name will be generated in the sys_temp schema and used in place
of tableName
. If persist
is false
(or
unspecified), then this is always allowed even if the caller
does not have permission to create tables. The generated name is
returned in qualified_table_name
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
: [DEPRECATED--please specify the containing
schema for the projection as part of tableName
and use
GPUdb.createSchema(CreateSchemaRequest)
to
create the schema if non-existent] Name of the schema for the
output table. If the schema provided is non-existent, it will be
automatically created. The default value is ''.
MODE
: If
merge_views
, then this operation will merge the provided
views. All tableNames
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).
EXCEPT_ALL
: Retains all rows(including duplicates) 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).
INTERSECT_ALL
: Retains all rows(including duplicates) 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. If this mode is selected
inputColumnNames
AND outputColumnNames
must be
empty. The resulting view would match the results of a SQL OR
operation, e.g., if filter 1 creates a view using the expression
'x = 20' and filter 2 creates a view using the expression 'x <=
10', then the merge views operation creates a new view using the
expression 'x = 20 OR x <= 10'.
UNION_ALL
.
CHUNK_SIZE
: Indicates the number of records per chunk to be
used for this output table.
CREATE_INDEXES
: Comma-separated list of columns on which to
create indexes on the output table. The columns specified must
be present in outputColumnNames
.
TTL
: Sets the
TTL
of the output table specified in tableName
.
PERSIST
:
If true
, then the output table specified in tableName
will be persisted and will not expire unless a ttl
is specified. If false
, then the output table
will be an in-memory table and will expire unless a ttl
is specified otherwise.
Supported values:
The default value is FALSE
.
VIEW_ID
:
ID of view of which this output table is a member. The default
value is ''.
FORCE_REPLICATED
: If true
, then the output table
specified in tableName
will be replicated even if the
source tables are not.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table and its columns.
Map
.public CreateUnionRequest setOptions(Map<String,String> options)
options
- Optional parameters.
CREATE_TEMP_TABLE
: If true
, a unique temporary
table name will be generated in the sys_temp schema and
used in place of tableName
. If persist
is false
(or unspecified), then this is always
allowed even if the caller does not have permission to
create tables. The generated name is returned in qualified_table_name
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
: [DEPRECATED--please specify the
containing schema for the projection as part of tableName
and use GPUdb.createSchema(CreateSchemaRequest)
to
create the schema if non-existent] Name of the schema
for the output table. If the schema provided is
non-existent, it will be automatically created. The
default value is ''.
MODE
: If merge_views
, then this operation will
merge the provided views. All tableNames
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).
EXCEPT_ALL
: Retains all rows(including duplicates) 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).
INTERSECT_ALL
: Retains all rows(including duplicates)
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. If
this mode is selected inputColumnNames
AND
outputColumnNames
must be empty. The resulting
view would match the results of a SQL OR operation,
e.g., if filter 1 creates a view using the expression 'x
= 20' and filter 2 creates a view using the expression
'x <= 10', then the merge views operation creates a new
view using the expression 'x = 20 OR x <= 10'.
UNION_ALL
.
CHUNK_SIZE
: Indicates the number of records per chunk
to be used for this output table.
CREATE_INDEXES
: Comma-separated list of columns on
which to create indexes on the output table. The
columns specified must be present in outputColumnNames
.
TTL
:
Sets the TTL of the output table specified in
tableName
.
PERSIST
: If true
, then the output table
specified in tableName
will be persisted and
will not expire unless a ttl
is specified. If
false
, then the output table will be an
in-memory table and will expire unless a ttl
is
specified otherwise.
Supported values:
The default value is FALSE
.
VIEW_ID
: ID of view of which this output table is a
member. The default value is ''.
FORCE_REPLICATED
: If true
, then the output
table specified in tableName
will be replicated
even if the source tables are not.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table and its
columns.
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 © 2024. All rights reserved.