GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gpudb::AppendRecordsRequest Struct Reference

A set of input parameters for const. More...

#include <gpudb/protocol/append_records.h>

Public Member Functions

 AppendRecordsRequest ()
 Constructs an AppendRecordsRequest object with default parameter values. More...
 
 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_)
 Constructs an AppendRecordsRequest object with the specified parameters. More...
 

Public Attributes

std::string tableName
 
std::string sourceTableName
 
std::map< std::string,
std::string > 
fieldMap
 
std::map< std::string,
std::string > 
options
 

Detailed Description

A set of input parameters for const.

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.

Constructor & Destructor Documentation

gpudb::AppendRecordsRequest::AppendRecordsRequest ( )
inline

Constructs an AppendRecordsRequest object with default parameter values.

Definition at line 29 of file append_records.h.

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.
  • gpudb::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'.
  • gpudb::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'.
  • gpudb::append_records_expression: Optional filter expression to apply to the sourceTableName. The default value is ''.
  • gpudb::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 ''.
  • gpudb::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. The default value is gpudb::append_records_false.
  • gpudb::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.
    • gpudb::append_records_true: Ignore source table records whose primary key values collide with those of target table records
    • gpudb::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 gpudb::append_records_false.
  • gpudb::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. The default value is gpudb::append_records_false.

Definition at line 178 of file append_records.h.

Member Data Documentation

std::map<std::string, std::string> gpudb::AppendRecordsRequest::fieldMap

Definition at line 188 of file append_records.h.

std::map<std::string, std::string> gpudb::AppendRecordsRequest::options

Definition at line 189 of file append_records.h.

std::string gpudb::AppendRecordsRequest::sourceTableName

Definition at line 187 of file append_records.h.

std::string gpudb::AppendRecordsRequest::tableName

Definition at line 186 of file append_records.h.


The documentation for this struct was generated from the following file: