GPUdb C++ API
Version 7.2.2.4
|
A set of parameters for GPUdb::updateRecordsRaw. More...
#include <gpudb/protocol/update_records.h>
Public Member Functions | |
RawUpdateRecordsRequest () | |
Constructs a RawUpdateRecordsRequest object with default parameters. More... | |
RawUpdateRecordsRequest (const std::string &tableName_, const std::vector< std::string > &expressions_, const std::vector< std::map< std::string, boost::optional< std::string > > > &newValuesMaps_, const std::vector< std::vector< uint8_t > > &recordsToInsert_, const std::map< std::string, std::string > &options_) | |
Constructs a RawUpdateRecordsRequest object with the specified parameters. More... | |
RawUpdateRecordsRequest (const std::string &tableName_, const std::vector< std::string > &expressions_, const std::vector< std::map< std::string, boost::optional< std::string > > > &newValuesMaps_, const std::vector< std::vector< uint8_t > > &recordsToInsert_, const std::vector< std::string > &recordsToInsertStr_, const std::string &recordEncoding_, const std::map< std::string, std::string > &options_) | |
Constructs a RawUpdateRecordsRequest object with the specified parameters. More... | |
Public Attributes | |
std::string | tableName |
Name of table to be updated, in [ schema_name. ]table_name format, using standard name resolution rules. More... | |
std::vector< std::string > | expressions |
A list of the actual predicates, one for each update; format should follow the guidelines here. More... | |
std::vector< std::map< std::string, boost::optional< std::string > > > | newValuesMaps |
List of new values for the matching records. More... | |
std::vector< std::vector< uint8_t > > | recordsToInsert |
An optional list of new binary-avro encoded records to insert, one for each update. More... | |
std::vector< std::string > | recordsToInsertStr |
An optional list of JSON encoded objects to insert, one for each update, to be added if the particular update did not match any objects. More... | |
std::string | recordEncoding |
Identifies which of recordsToInsert and recordsToInsertStr should be used. More... | |
std::map< std::string, std::string > | options |
Optional parameters. More... | |
A set of parameters for GPUdb::updateRecordsRaw.
Runs multiple predicate-based updates in a single call. With the list of given expressions, any matching record's column values will be updated as provided in newValuesMaps. There is also an optional 'upsert' capability where if a particular predicate doesn't match any existing record, then a new record can be inserted.
Note that this operation can only be run on an original table and not on a result view.
This operation can update primary key values. By default only 'pure primary key' predicates are allowed when updating primary key values. If the primary key for a table is the column 'attr1', then the operation will only accept predicates of the form: "attr1 == 'foo'" if the attr1 column is being updated. For a composite primary key (e.g. columns 'attr1' and 'attr2') then this operation will only accept predicates of the form: "(attr1 == 'foo') and (attr2 == 'bar')". Meaning, all primary key columns must appear in an equality predicate in the expressions. Furthermore each 'pure primary key' predicate must be unique within a given request. These restrictions can be removed by utilizing some available options through options.
The update_on_existing_pk option specifies the record primary key collision policy for tables with a primary key, while ignore_existing_pk specifies the record primary key collision error-suppression policy when those collisions result in the update being rejected. Both are ignored on tables with no primary key.
Definition at line 46 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with default parameters.
Definition at line 51 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with the specified parameters.
[in] | tableName_ | Name of table to be updated, in [schema_name.]table_name format, using standard name resolution rules. Must be a currently existing table and not a view. |
[in] | expressions_ | A list of the actual predicates, one for each update; format should follow the guidelines here. |
[in] | newValuesMaps_ | List of new values for the matching records. Each element is a map with (key, value) pairs where the keys are the names of the columns whose values are to be updated; the values are the new values. The number of elements in the list should match the length of expressions_. |
[in] | recordsToInsert_ | An optional list of new binary-avro encoded records to insert, one for each update. If one of expressions_ does not yield a matching record to be updated, then the corresponding element from this list will be added to the table. The default value is an empty vector. |
[in] | options_ | Optional parameters.
|
Definition at line 316 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with the specified parameters.
[in] | tableName_ | Name of table to be updated, in [schema_name.]table_name format, using standard name resolution rules. Must be a currently existing table and not a view. |
[in] | expressions_ | A list of the actual predicates, one for each update; format should follow the guidelines here. |
[in] | newValuesMaps_ | List of new values for the matching records. Each element is a map with (key, value) pairs where the keys are the names of the columns whose values are to be updated; the values are the new values. The number of elements in the list should match the length of expressions_. |
[in] | recordsToInsert_ | An optional list of new binary-avro encoded records to insert, one for each update. If one of expressions_ does not yield a matching record to be updated, then the corresponding element from this list will be added to the table. The default value is an empty vector. |
[in] | recordsToInsertStr_ | An optional list of JSON encoded objects to insert, one for each update, to be added if the particular update did not match any objects. The default value is an empty vector. |
[in] | recordEncoding_ | Identifies which of recordsToInsert_ and recordsToInsertStr_ should be used. Supported values: The default value is update_records_binary. |
[in] | options_ | Optional parameters.
|
Definition at line 601 of file update_records.h.
std::vector<std::string> gpudb::RawUpdateRecordsRequest::expressions |
A list of the actual predicates, one for each update; format should follow the guidelines here.
Definition at line 626 of file update_records.h.
std::vector<std::map<std::string, boost::optional<std::string> > > gpudb::RawUpdateRecordsRequest::newValuesMaps |
List of new values for the matching records.
Each element is a map with (key, value) pairs where the keys are the names of the columns whose values are to be updated; the values are the new values. The number of elements in the list should match the length of expressions.
Definition at line 635 of file update_records.h.
std::map<std::string, std::string> gpudb::RawUpdateRecordsRequest::options |
Optional parameters.
The default value is an empty map.
Definition at line 821 of file update_records.h.
std::string gpudb::RawUpdateRecordsRequest::recordEncoding |
Identifies which of recordsToInsert and recordsToInsertStr should be used.
Supported values:
The default value is update_records_binary.
Definition at line 664 of file update_records.h.
std::vector<std::vector<uint8_t> > gpudb::RawUpdateRecordsRequest::recordsToInsert |
An optional list of new binary-avro encoded records to insert, one for each update.
If one of expressions does not yield a matching record to be updated, then the corresponding element from this list will be added to the table. The default value is an empty vector.
Definition at line 644 of file update_records.h.
std::vector<std::string> gpudb::RawUpdateRecordsRequest::recordsToInsertStr |
An optional list of JSON encoded objects to insert, one for each update, to be added if the particular update did not match any objects.
The default value is an empty vector.
Definition at line 651 of file update_records.h.
std::string gpudb::RawUpdateRecordsRequest::tableName |
Name of table to be updated, in [ schema_name. ]table_name format, using standard name resolution rules.
Must be a currently existing table and not a view.
Definition at line 619 of file update_records.h.