public class MergeRecordsRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.mergeRecords(MergeRecordsRequest)
.
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
). 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
. Read more about Merge Records here.
Modifier and Type | Class and Description |
---|---|
static class |
MergeRecordsRequest.Options
Optional parameters.
|
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() |
Map<String,String> |
getOptions() |
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() |
String |
getTableName() |
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) |
MergeRecordsRequest |
setOptions(Map<String,String> options) |
MergeRecordsRequest |
setSourceTableNames(List<String> sourceTableNames) |
MergeRecordsRequest |
setTableName(String tableName) |
String |
toString() |
public MergeRecordsRequest()
public MergeRecordsRequest(String tableName, List<String> sourceTableNames, List<Map<String,String>> fieldMaps, Map<String,String> options)
tableName
- The new result table name for the records to be
merged. Must NOT be an existing table.sourceTableNames
- The list of source table names to get the
records from. 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 (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.
COLLECTION_NAME
: Name of a collection which is to
contain the newly created merged table specified by
tableName
. If the collection provided is
non-existent, the collection will be automatically
created. If empty, then the newly created merged table
will be a top-level table.
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
.
CHUNK_SIZE
: Indicates the chunk size to be used for the
merged table specified in tableName
.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public MergeRecordsRequest setTableName(String tableName)
tableName
- The new result table name for the records to be
merged. Must NOT be an existing table.this
to mimic the builder pattern.public List<String> getSourceTableNames()
public MergeRecordsRequest setSourceTableNames(List<String> sourceTableNames)
sourceTableNames
- The list of source table names to get the
records from. Must be existing table names.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 (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.public MergeRecordsRequest setFieldMaps(List<Map<String,String>> fieldMaps)
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 (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.this
to mimic the builder pattern.public Map<String,String> getOptions()
COLLECTION_NAME
: Name of a collection which is to contain the
newly created merged table specified by tableName
. If
the collection provided is non-existent, the collection will be
automatically created. If empty, then the newly created merged
table will be a top-level table.
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
.
CHUNK_SIZE
: Indicates the chunk size to be used for the merged
table specified in tableName
.
public MergeRecordsRequest setOptions(Map<String,String> options)
options
- Optional parameters.
COLLECTION_NAME
: Name of a collection which is to
contain the newly created merged table specified by
tableName
. If the collection provided is
non-existent, the collection will be automatically
created. If empty, then the newly created merged table
will be a top-level table.
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
.
CHUNK_SIZE
: Indicates the chunk size to be used for the
merged table specified in tableName
.
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.