public class AppendRecordsRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.appendRecords(AppendRecordsRequest)
.
Append (or insert) all records from a source table (specified by sourceTableName
) to a particular target table (specified by tableName
). The field map (specified by fieldMap
) holds the user
specified map of target table column names with their mapped source column
names.
Modifier and Type | Class and Description |
---|---|
static class |
AppendRecordsRequest.Options
Optional parameters.
|
Constructor and Description |
---|
AppendRecordsRequest()
Constructs an AppendRecordsRequest object with default parameters.
|
AppendRecordsRequest(String tableName,
String sourceTableName,
Map<String,String> fieldMap,
Map<String,String> options)
Constructs an AppendRecordsRequest 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.
|
Map<String,String> |
getFieldMap() |
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.
|
String |
getSourceTableName() |
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.
|
AppendRecordsRequest |
setFieldMap(Map<String,String> fieldMap) |
AppendRecordsRequest |
setOptions(Map<String,String> options) |
AppendRecordsRequest |
setSourceTableName(String sourceTableName) |
AppendRecordsRequest |
setTableName(String tableName) |
String |
toString() |
public AppendRecordsRequest()
public AppendRecordsRequest(String tableName, String sourceTableName, Map<String,String> fieldMap, Map<String,String> options)
tableName
- The table name for the records to be appended. Must be
an existing table.sourceTableName
- The source table name to get records from. Must
be an existing table name.fieldMap
- Contains the mapping of column names from the target
table (specified by tableName
) as the keys, and
corresponding column names from the source table
(specified by sourceTableName
). Must be
existing column names in source table and target table,
and their types must be matched.options
- Optional parameters.
OFFSET
: A positive integer indicating the number of
initial results to skip from source table (specified by
sourceTableName
). Default is 0. The minimum
allowed value is 0. The maximum allowed value is
MAX_INT.
LIMIT
: A positive integer indicating the maximum number
of results to be returned from source table (specified
by sourceTableName
). Or END_OF_SET (-9999) to
indicate that the max number of results should be
returned.
EXPRESSION
: Optional filter expression to apply to the
source table (specified by sourceTableName
).
Empty by default.
ORDER_BY
: Comma-separated list of the columns to be
sorted from source table (specified by sourceTableName
) by; e.g. 'timestamp asc, x desc'. The
columns specified must be present in fieldMap
.
If any alias is given for any column name, the alias
must be used, rather than the original column name.
UPDATE_ON_EXISTING_PK
: Specifies the record collision
policy for inserting the source table records (specified
by sourceTableName
) into the target table
(specified by tableName
) table with a primary key. If set to true
,
any existing target table record with primary key values
that match those of a source table record being inserted
will be replaced by that new record. If set to false
, any existing target table record with primary
key values that match those of a source table record
being inserted will remain unchanged and the new record
discarded. If the specified table does not have a
primary key, then this option is ignored.
Supported values:
The default value is FALSE
.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public AppendRecordsRequest setTableName(String tableName)
tableName
- The table name for the records to be appended. Must be
an existing table.this
to mimic the builder pattern.public String getSourceTableName()
public AppendRecordsRequest setSourceTableName(String sourceTableName)
sourceTableName
- The source table name to get records from. Must
be an existing table name.this
to mimic the builder pattern.public Map<String,String> getFieldMap()
tableName
) as the keys, and corresponding
column names from the source table (specified by sourceTableName
). Must be existing column names in source table
and target table, and their types must be matched.public AppendRecordsRequest setFieldMap(Map<String,String> fieldMap)
fieldMap
- Contains the mapping of column names from the target
table (specified by tableName
) as the keys, and
corresponding column names from the source table
(specified by sourceTableName
). Must be
existing column names in source table and target table,
and their types must be matched.this
to mimic the builder pattern.public Map<String,String> getOptions()
OFFSET
:
A positive integer indicating the number of initial results to
skip from source table (specified by sourceTableName
).
Default is 0. The minimum allowed value is 0. The maximum
allowed value is MAX_INT.
LIMIT
: A
positive integer indicating the maximum number of results to be
returned from source table (specified by sourceTableName
). Or END_OF_SET (-9999) to indicate that the
max number of results should be returned.
EXPRESSION
: Optional filter expression to apply to the source
table (specified by sourceTableName
). Empty by default.
ORDER_BY
: Comma-separated list of the columns to be sorted from
source table (specified by sourceTableName
) by; e.g.
'timestamp asc, x desc'. The columns specified must be present
in fieldMap
. If any alias is given for any column name,
the alias must be used, rather than the original column name.
UPDATE_ON_EXISTING_PK
: Specifies the record collision policy
for inserting the source table records (specified by sourceTableName
) into the target table (specified by tableName
) table with a primary key. If set to true
, any
existing target table record with primary key values that match
those of a source table record being inserted will be replaced
by that new record. If set to false
, any existing
target table record with primary key values that match those of
a source table record being inserted will remain unchanged and
the new record discarded. If the specified table does not have
a primary key, then this option is ignored.
Supported values:
The default value is FALSE
.
public AppendRecordsRequest setOptions(Map<String,String> options)
options
- Optional parameters.
OFFSET
: A positive integer indicating the number of
initial results to skip from source table (specified by
sourceTableName
). Default is 0. The minimum
allowed value is 0. The maximum allowed value is
MAX_INT.
LIMIT
: A positive integer indicating the maximum number
of results to be returned from source table (specified
by sourceTableName
). Or END_OF_SET (-9999) to
indicate that the max number of results should be
returned.
EXPRESSION
: Optional filter expression to apply to the
source table (specified by sourceTableName
).
Empty by default.
ORDER_BY
: Comma-separated list of the columns to be
sorted from source table (specified by sourceTableName
) by; e.g. 'timestamp asc, x desc'. The
columns specified must be present in fieldMap
.
If any alias is given for any column name, the alias
must be used, rather than the original column name.
UPDATE_ON_EXISTING_PK
: Specifies the record collision
policy for inserting the source table records (specified
by sourceTableName
) into the target table
(specified by tableName
) table with a primary key. If set to true
,
any existing target table record with primary key values
that match those of a source table record being inserted
will be replaced by that new record. If set to false
, any existing target table record with primary
key values that match those of a source table record
being inserted will remain unchanged and the new record
discarded. If the specified table does not have a
primary key, then this option is ignored.
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 © 2018. All rights reserved.