public class MergeRecordsRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.mergeRecords
.
Create a new empty result table (specified by tableName
), and insert all records from source tables (specified by sourceTableNames
) based on the field mapping
information (specified by fieldMaps
).
For merge records details and examples, see Merge Records. For limitations, see Merge Records Limitations and Cautions.
The field map (specified by fieldMaps
) holds the
user-specified maps of target table column names to source table columns.
The array of fieldMaps
must match one-to-one with
the sourceTableNames
, e.g., there's a map
present in fieldMaps
for each table listed in sourceTableNames
.
Modifier and Type | Class and Description |
---|---|
static class |
MergeRecordsRequest.Options
A set of string constants for the
MergeRecordsRequest parameter
options . |
Constructor and Description |
---|
MergeRecordsRequest()
Constructs a MergeRecordsRequest object with default parameters.
|
MergeRecordsRequest(String tableName,
List<String> sourceTableNames,
List<Map<String,String>> fieldMaps,
Map<String,String> options)
Constructs a MergeRecordsRequest 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<Map<String,String>> |
getFieldMaps()
Contains a list of source/target column mappings, one mapping for each
source table listed in
sourceTableNames
being merged into the target table specified by tableName . |
||||
Map<String,String> |
getOptions()
Optional parameters.
|
||||
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
||||
List<String> |
getSourceTableNames()
The list of names of source tables to get the records from, each in
[schema_name.]table_name format, using standard
String getTableName()
The name of the new result table for the records to be merged into, in
[schema_name.]table_name format, using standard
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.
|
||||
MergeRecordsRequest |
setFieldMaps(List<Map<String,String>> fieldMaps)
Contains a list of source/target column mappings, one mapping for each
source table listed in
sourceTableNames
being merged into the target table specified by tableName . |
||||
MergeRecordsRequest |
setOptions(Map<String,String> options)
Optional parameters.
|
||||
MergeRecordsRequest |
setSourceTableNames(List<String> sourceTableNames)
The list of names of source tables to get the records from, each in
[schema_name.]table_name format, using standard
MergeRecordsRequest setTableName(String tableName)
|
public MergeRecordsRequest()
public MergeRecordsRequest(String tableName, List<String> sourceTableNames, List<Map<String,String>> fieldMaps, Map<String,String> options)
tableName
- The name of the new result table for the records to be
merged into, in [schema_name.]table_name format, using
standard name resolution rules and meeting table naming criteria. Must NOT be
an existing table.sourceTableNames
- The list of names of source tables to get the
records from, each in [schema_name.]table_name
format, using standard name resolution rules. Must
be existing table names.fieldMaps
- Contains a list of source/target column mappings, one
mapping for each source table listed in sourceTableNames
being merged into the target table
specified by tableName
. Each mapping contains
the target column names (as keys) that the data in the
mapped source columns or column expressions (as values) will be
merged into. All of the source columns being merged
into a given target column must match in type, as that
type will determine the type of the new target column.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
, 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 merged table as part of tableName
and use GPUdb.createSchema
to create the schema if
non-existent] Name of a schema for the newly
created merged table specified by tableName
.
IS_REPLICATED
:
Indicates the distribution scheme for the
data of the merged table specified in tableName
. If true, the table will be replicated. If false, the
table will be randomly sharded.
Supported values:
The default value is FALSE
.
TTL
: Sets the TTL of the merged table
specified in tableName
.
PERSIST
: If TRUE
, then the table specified in
tableName
will be persisted and will not
expire unless a TTL
is
specified. If FALSE
,
then the table will be an in-memory table and
will expire unless a TTL
is
specified otherwise.
Supported values:
The default value is TRUE
.
CHUNK_SIZE
: Indicates
the number of records per chunk to be used for
the merged table specified in tableName
.
CHUNK_COLUMN_MAX_MEMORY
: Indicates the target
maximum data size for each column in a chunk to
be used for the merged table specified in tableName
.
CHUNK_MAX_MEMORY
: Indicates the target maximum
data size for all columns in a chunk to be used
for the merged table specified in tableName
.
VIEW_ID
: view this
result table is part of. The default value is
''.
Map
.public static org.apache.avro.Schema getClassSchema()
public String getTableName()
tableName
.public MergeRecordsRequest setTableName(String tableName)
tableName
- The new value for tableName
.this
to mimic the builder pattern.public List<String> getSourceTableNames()
sourceTableNames
.public MergeRecordsRequest setSourceTableNames(List<String> sourceTableNames)
sourceTableNames
- The new value for sourceTableNames
.this
to mimic the builder pattern.public List<Map<String,String>> getFieldMaps()
sourceTableNames
being merged into the target table specified by tableName
. Each mapping contains the target column names (as keys)
that the data in the mapped source columns or column expressions (as values) will be merged into. All of
the source columns being merged into a given target column must match in
type, as that type will determine the type of the new target column.fieldMaps
.public MergeRecordsRequest setFieldMaps(List<Map<String,String>> fieldMaps)
sourceTableNames
being merged into the target table specified by tableName
. Each mapping contains the target column names (as keys)
that the data in the mapped source columns or column expressions (as values) will be merged into. All of
the source columns being merged into a given target column must match in
type, as that type will determine the type of the new target column.fieldMaps
- The new value for fieldMaps
.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
, 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 merged
table as part of tableName
and use
GPUdb.createSchema
to create the schema if non-existent] Name
of a schema for the newly created merged table specified by
tableName
.
IS_REPLICATED
: Indicates the distribution scheme for the data of the merged
table specified in tableName
. If true,
the table will be replicated. If false, the table will be randomly sharded.
Supported values:
The default value is FALSE
.
TTL
: Sets the TTL of
the merged table specified in tableName
.
PERSIST
: If TRUE
,
then the table specified in tableName
will be persisted and will not expire unless a TTL
is specified. If FALSE
,
then the table will be an in-memory table and will expire unless
a TTL
is specified otherwise.
Supported values:
The default value is TRUE
.
CHUNK_SIZE
: Indicates the number of
records per chunk to be used for the merged table specified in
tableName
.
CHUNK_COLUMN_MAX_MEMORY
:
Indicates the target maximum data size for each column in a
chunk to be used for the merged table specified in tableName
.
CHUNK_MAX_MEMORY
: Indicates the
target maximum data size for all columns in a chunk to be used
for the merged table specified in tableName
.
VIEW_ID
: view this result table is part
of. The default value is ''.
Map
.options
.public MergeRecordsRequest setOptions(Map<String,String> options)
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
, 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 merged
table as part of tableName
and use
GPUdb.createSchema
to create the schema if non-existent] Name
of a schema for the newly created merged table specified by
tableName
.
IS_REPLICATED
: Indicates the distribution scheme for the data of the merged
table specified in tableName
. If true,
the table will be replicated. If false, the table will be randomly sharded.
Supported values:
The default value is FALSE
.
TTL
: Sets the TTL of
the merged table specified in tableName
.
PERSIST
: If TRUE
,
then the table specified in tableName
will be persisted and will not expire unless a TTL
is specified. If FALSE
,
then the table will be an in-memory table and will expire unless
a TTL
is specified otherwise.
Supported values:
The default value is TRUE
.
CHUNK_SIZE
: Indicates the number of
records per chunk to be used for the merged table specified in
tableName
.
CHUNK_COLUMN_MAX_MEMORY
:
Indicates the target maximum data size for each column in a
chunk to be used for the merged table specified in tableName
.
CHUNK_MAX_MEMORY
: Indicates the
target maximum data size for all columns in a chunk to be used
for the merged table specified in tableName
.
VIEW_ID
: view this result table is part
of. The default value is ''.
Map
.options
- The new value for options
.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 © 2025. All rights reserved.