A set of parameters for GPUdb::appendRecords.
More...
#include <gpudb/protocol/append_records.h>
|
std::string | tableName |
| The table name for the records to be appended, in [ schema_name. More...
|
|
std::string | sourceTableName |
| The source table name to get records from, in [ schema_name. More...
|
|
std::map< std::string, std::string > | fieldMap |
| Contains the mapping of column names from the target table (specified by tableName) as the keys, and corresponding column names or expressions (e.g., 'col_name+1') from the source table (specified by sourceTableName). More...
|
|
std::map< std::string, std::string > | options |
| Optional parameters. More...
|
|
A set of parameters for GPUdb::appendRecords.
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.
Definition at line 22 of file append_records.h.
◆ AppendRecordsRequest() [1/2]
gpudb::AppendRecordsRequest::AppendRecordsRequest |
( |
| ) |
|
|
inline |
◆ AppendRecordsRequest() [2/2]
gpudb::AppendRecordsRequest::AppendRecordsRequest |
( |
const std::string & |
tableName_, |
|
|
const std::string & |
sourceTableName_, |
|
|
const std::map< std::string, std::string > & |
fieldMap_, |
|
|
const std::map< std::string, std::string > & |
options_ |
|
) |
| |
|
inline |
Constructs an AppendRecordsRequest object with the specified parameters.
- Parameters
-
[in] | tableName_ | The table name for the records to be appended, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table. |
[in] | sourceTableName_ | The source table name to get records from, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table name. |
[in] | fieldMap_ | Contains the mapping of column names from the target table (specified by tableName_) as the keys, and corresponding column names or expressions (e.g., 'col_name+1') from the source table (specified by sourceTableName_). Must be existing column names in source table and target table, and their types must be matched. For details on using expressions, see Expressions. |
[in] | options_ | Optional parameters.
-
append_records_offset: A positive integer indicating the number of initial results to skip from sourceTableName_. Default is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT. The default value is '0'.
-
append_records_limit: A positive integer indicating the maximum number of results to be returned from sourceTableName_. Or END_OF_SET (-9999) to indicate that the max number of results should be returned. The default value is '-9999'.
-
append_records_expression: Optional filter expression to apply to the sourceTableName_. The default value is ''.
-
append_records_order_by: Comma-separated list of the columns to be sorted by from source table (specified by sourceTableName_), e.g., 'timestamp asc, x desc'. The order_by columns do not have to be present in fieldMap_. The default value is ''.
-
append_records_update_on_existing_pk: Specifies the record collision policy for inserting source table records (specified by sourceTableName_) into a target table (specified by tableName_) with a primary key. If set to true, any existing table record with primary key values that match those of a source table record being inserted will be replaced by that new record (the new data will be "upserted"). If set to false, any existing table record with primary key values that match those of a source table record being inserted will remain unchanged, while the source record will be rejected and an error handled as determined by ignore_existing_pk. If the specified table does not have a primary key, then this option has no effect. Supported values:
The default value is append_records_false.
-
append_records_ignore_existing_pk: Specifies the record collision error-suppression policy for inserting source table records (specified by sourceTableName_) into a target table (specified by tableName_) with a primary key, only used when not in upsert mode (upsert mode is disabled when update_on_existing_pk is false). If set to true, any source table record being inserted that is rejected for having primary key values that match those of an existing target table record will be ignored with no error generated. If false, the rejection of any source table record for having primary key values matching an existing target table record will result in an error being raised. If the specified table does not have a primary key or if upsert mode is in effect (update_on_existing_pk is true), then this option has no effect. Supported values:
-
append_records_true: Ignore source table records whose primary key values collide with those of target table records
-
append_records_false: Raise an error for any source table record whose primary key values collide with those of a target table record
The default value is append_records_false.
-
append_records_truncate_strings: If set to true, it allows inserting longer strings into smaller charN string columns by truncating the longer strings to fit. Supported values:
The default value is append_records_false.
The default value is an empty map. |
Definition at line 212 of file append_records.h.
◆ fieldMap
std::map<std::string, std::string> gpudb::AppendRecordsRequest::fieldMap |
Contains the mapping of column names from the target table (specified by tableName) as the keys, and corresponding column names or expressions (e.g., 'col_name+1') from the source table (specified by sourceTableName).
Must be existing column names in source table and target table, and their types must be matched. For details on using expressions, see Expressions.
Definition at line 246 of file append_records.h.
◆ options
std::map<std::string, std::string> gpudb::AppendRecordsRequest::options |
Optional parameters.
-
append_records_offset: A positive integer indicating the number of initial results to skip from sourceTableName. Default is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT. The default value is '0'.
-
append_records_limit: A positive integer indicating the maximum number of results to be returned from sourceTableName. Or END_OF_SET (-9999) to indicate that the max number of results should be returned. The default value is '-9999'.
-
append_records_expression: Optional filter expression to apply to the sourceTableName. The default value is ''.
-
append_records_order_by: Comma-separated list of the columns to be sorted by from source table (specified by sourceTableName), e.g., 'timestamp asc, x desc'. The order_by columns do not have to be present in fieldMap. The default value is ''.
-
append_records_update_on_existing_pk: Specifies the record collision policy for inserting source table records (specified by sourceTableName) into a target table (specified by tableName) with a primary key. If set to true, any existing table record with primary key values that match those of a source table record being inserted will be replaced by that new record (the new data will be "upserted"). If set to false, any existing table record with primary key values that match those of a source table record being inserted will remain unchanged, while the source record will be rejected and an error handled as determined by ignore_existing_pk. If the specified table does not have a primary key, then this option has no effect. Supported values:
The default value is append_records_false.
-
append_records_ignore_existing_pk: Specifies the record collision error-suppression policy for inserting source table records (specified by sourceTableName) into a target table (specified by tableName) with a primary key, only used when not in upsert mode (upsert mode is disabled when update_on_existing_pk is false). If set to true, any source table record being inserted that is rejected for having primary key values that match those of an existing target table record will be ignored with no error generated. If false, the rejection of any source table record for having primary key values matching an existing target table record will result in an error being raised. If the specified table does not have a primary key or if upsert mode is in effect (update_on_existing_pk is true), then this option has no effect. Supported values:
-
append_records_true: Ignore source table records whose primary key values collide with those of target table records
-
append_records_false: Raise an error for any source table record whose primary key values collide with those of a target table record
The default value is append_records_false.
-
append_records_truncate_strings: If set to true, it allows inserting longer strings into smaller charN string columns by truncating the longer strings to fit. Supported values:
The default value is append_records_false.
The default value is an empty map.
Definition at line 352 of file append_records.h.
◆ sourceTableName
std::string gpudb::AppendRecordsRequest::sourceTableName |
The source table name to get records from, in [ schema_name.
\ ]table_name format, using standard name resolution rules. Must be an existing table name.
Definition at line 235 of file append_records.h.
◆ tableName
std::string gpudb::AppendRecordsRequest::tableName |
The table name for the records to be appended, in [ schema_name.
\ ]table_name format, using standard name resolution rules. Must be an existing table.
Definition at line 226 of file append_records.h.
The documentation for this struct was generated from the following file: