GPUdb C++ API
Version 5.2.0.0
|
A set of input parameters for updateRecordsRaw(const RawUpdateRecordsRequest&) const. More...
#include <gpudb/protocol/update_records.h>
Public Member Functions | |
RawUpdateRecordsRequest () | |
Constructs a RawUpdateRecordsRequest object with default parameter values. More... | |
RawUpdateRecordsRequest (const std::string &tableName, const std::vector< std::string > &expressions, const std::vector< std::map< std::string, 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, 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 |
std::vector< std::string > | expressions |
std::vector< std::map< std::string, std::string > > | newValuesMaps |
std::vector< std::vector< uint8_t > > | recordsToInsert |
std::vector< std::string > | recordsToInsertStr |
std::string | recordEncoding |
std::map< std::string, std::string > | options |
A set of input parameters for updateRecordsRaw(const RawUpdateRecordsRequest&) const.
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 collection or 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.
Definition at line 37 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with default parameter values.
Definition at line 44 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with the specified parameters.
[in] | tableName | Table to be updated. Must be a currently existing table and not a collection or view. |
[in] | expressions | A list of the actual predicates, one for each update; format should follow the guidelines /filter. |
[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. Default value is an empty std::vector. |
[in] | options | Optional parameters.
|
Definition at line 106 of file update_records.h.
|
inline |
Constructs a RawUpdateRecordsRequest object with the specified parameters.
[in] | tableName | Table to be updated. Must be a currently existing table and not a collection or view. |
[in] | expressions | A list of the actual predicates, one for each update; format should follow the guidelines /filter. |
[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. Default value is an empty std::vector. |
[in] | recordsToInsertStr | An optional list of new json-avro encoded objects to insert, one for each update, to be added to the set if the particular update did not affect any objects. Default value is an empty std::vector. |
[in] | recordEncoding | Identifies which of recordsToInsert and recordsToInsertStr should be used. Values: 'binary', 'json'. Default value is 'binary'. |
[in] | options | Optional parameters.
|
Definition at line 178 of file update_records.h.
std::vector<std::string> gpudb::RawUpdateRecordsRequest::expressions |
Definition at line 190 of file update_records.h.
std::vector<std::map<std::string, std::string> > gpudb::RawUpdateRecordsRequest::newValuesMaps |
Definition at line 191 of file update_records.h.
std::map<std::string, std::string> gpudb::RawUpdateRecordsRequest::options |
Definition at line 195 of file update_records.h.
std::string gpudb::RawUpdateRecordsRequest::recordEncoding |
Definition at line 194 of file update_records.h.
std::vector<std::vector<uint8_t> > gpudb::RawUpdateRecordsRequest::recordsToInsert |
Definition at line 192 of file update_records.h.
std::vector<std::string> gpudb::RawUpdateRecordsRequest::recordsToInsertStr |
Definition at line 193 of file update_records.h.
std::string gpudb::RawUpdateRecordsRequest::tableName |
Definition at line 189 of file update_records.h.