A set of parameters for Kinetica.updateRecords. More…
Classes | |
| struct | Options |
| A set of string constants for the parameter RawUpdateRecordsRequest.options. More… | |
Public Member Functions | |
| UpdateRecordsRequest () | |
| Constructs an UpdateRecordsRequest object with default parameters. | |
| UpdateRecordsRequest (string table_name, IList< string > expressions, IList< IDictionary< string, string > > new_values_maps, IList< T > data=null, IDictionary< string, string > options=null) | |
| Constructs an UpdateRecordsRequest object with the specified parameters. | |
| UpdateRecordsRequest () | |
| Constructs an UpdateRecordsRequest object with default parameters. | |
| UpdateRecordsRequest (string table_name, IList< string > expressions, IList< IDictionary< string, string > > new_values_maps, IList< T > data=null, IDictionary< string, string > options=null) | |
| Constructs an UpdateRecordsRequest object with the specified parameters. | |
| Public Member Functions inherited from kinetica.KineticaData | |
| KineticaData (KineticaType type) | |
| Constructor from Kinetica Type. | |
| KineticaData (System.Type type=null) | |
| Default constructor, with optional System.Type. | |
| object | Get (int fieldPos) |
| Retrieve a specific property from this object. | |
| void | Put (int fieldPos, object fieldValue) |
| Write a specific property to this object. | |
| KineticaData (KineticaType type) | |
| Constructor from Kinetica Type. | |
| KineticaData (System.Type type=null) | |
| Default constructor, with optional System.Type. | |
| object | Get (int fieldPos) |
| Retrieve a specific property from this object. | |
| void | Put (int fieldPos, object fieldValue) |
| Write a specific property to this object. | |
Static Public Attributes | |
| const string | GLOBAL_EXPRESSION = “global_expression” |
| An optional global expression to reduce the search space of the predicates listed in RawUpdateRecordsRequest.expressions. | |
| const string | BYPASS_SAFETY_CHECKS = “bypass_safety_checks” |
| When set to TRUE, all predicates are available for primary key updates. | |
| const string | TRUE = “true” |
| A boolean constant for the RawUpdateRecordsRequest.Options options. | |
| const string | FALSE = “false” |
| A boolean constant for the RawUpdateRecordsRequest.Options options. | |
| const string | UPDATE_ON_EXISTING_PK = “update_on_existing_pk” |
| Specifies the record collision policy for updating a table with a primary key. | |
| const string | IGNORE_EXISTING_PK = “ignore_existing_pk” |
| Specifies the record collision error-suppression policy for updating a table with a primary key, only used when primary key record collisions are rejected (UPDATE_ON_EXISTING_PK is FALSE). | |
| const string | UPDATE_PARTITION = “update_partition” |
| Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated. | |
| const string | ENABLE_INPLACE_UPDATES = “enable_inplace_updates” |
| If set to TRUE, qualifying records are modified in place. | |
| const string | TRUNCATE_STRINGS = “truncate_strings” |
| If set to TRUE, any strings which are too long for their charN string fields will be truncated to fit. | |
| const string | USE_EXPRESSIONS_IN_NEW_VALUES_MAPS = “use_expressions_in_new_values_maps” |
| When set to TRUE, all new values in RawUpdateRecordsRequest.new_values_maps are considered as expression values. | |
| const string | RECORD_ID = “record_id” |
| ID of a single record to be updated (returned in the call to Kinetica.insertRecords or Kinetica.getRecordsFromCollection). | |
Properties | |
| string | table_name [get, set] |
| Name of table to be updated, in [schema_name. | |
| IList< string > | expressions = new List<string>() [get, set] |
| A list of the actual predicates, one for each update; format should follow the guidelines here. | |
| IList< IDictionary< string, string > > | new_values_maps = new List<IDictionary<string, string>>() [get, set] |
| List of new values for the matching records. | |
| IList< T > | data = new List<T>() [get, set] |
| An optional list of new binary-avro encoded records to insert, one for each update. | |
| IDictionary< string, string > | options = new Dictionary<string, string>() [get, set] |
| Optional parameters. | |
| Properties inherited from kinetica.KineticaData | |
| Schema | Schema [get] |
| Avro Schema for this class. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from kinetica.KineticaData | |
| static ? RecordSchema | SchemaFromType (System.Type t, KineticaType? ktype=null) |
| Create an Avro Schema from a System.Type and a KineticaType. | |
| static ? RecordSchema | SchemaFromType (System.Type t, KineticaType? ktype=null) |
| Create an Avro Schema from a System.Type and a KineticaType. | |
Detailed Description
A set of parameters for Kinetica.updateRecords.
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 RawUpdateRecordsRequest.new_values_maps. 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 RawUpdateRecordsRequest.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.
| T | The type of object being processed. |
Definition at line 1341 of file UpdateRecords.cs.
Member Function Documentation
◆ UpdateRecordsRequest() [1/4]
| inline |
Constructs an UpdateRecordsRequest object with default parameters.
Definition at line 1900 of file UpdateRecords.cs.
◆ UpdateRecordsRequest() [2/4]
| inline |
Constructs an UpdateRecordsRequest object with default parameters.
Definition at line 1900 of file UpdateRecords.cs.
◆ UpdateRecordsRequest() [3/4]
| inline |
Constructs an UpdateRecordsRequest object with the specified parameters.
| table_name | 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. |
| expressions | A list of the actual predicates, one for each update; format should follow the guidelines here. |
| new_values_maps | 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 . |
| data | 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 List. |
| options | Optional parameters.
|
Definition at line 2190 of file UpdateRecords.cs.
◆ UpdateRecordsRequest() [4/4]
| inline |
Constructs an UpdateRecordsRequest object with the specified parameters.
| table_name | 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. |
| expressions | A list of the actual predicates, one for each update; format should follow the guidelines here. |
| new_values_maps | 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 . |
| data | 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 List. |
| options | Optional parameters.
|
Definition at line 2190 of file UpdateRecords.cs.
Member Data Documentation
◆ BYPASS_SAFETY_CHECKS
| static |
When set to TRUE, all predicates are available for primary key updates.
Keep in mind that it is possible to destroy data in this case, since a single predicate may match multiple objects (potentially all of records of a table), and then updating all of those records to have the same primary key will, due to the primary key uniqueness constraints, effectively delete all but one of those updated records. Supported values:
The default value is FALSE.
Definition at line 1379 of file UpdateRecords.cs.
◆ ENABLE_INPLACE_UPDATES
| static |
If set to TRUE, qualifying records are modified in place.
If set to FALSE, they are updated by deleting the existing record and inserting a replacement (delete and insert), which prevents the change from being reflected in dependent materialized views until they are refreshed. Supported values:
The default value is TRUE.
Definition at line 1534 of file UpdateRecords.cs.
◆ FALSE
| static |
A boolean constant for the RawUpdateRecordsRequest.Options options.
Definition at line 1387 of file UpdateRecords.cs.
◆ GLOBAL_EXPRESSION
| static |
An optional global expression to reduce the search space of the predicates listed in RawUpdateRecordsRequest.expressions.
The default value is ”.
Definition at line 1352 of file UpdateRecords.cs.
◆ IGNORE_EXISTING_PK
| static |
Specifies the record collision error-suppression policy for updating a table with a primary key, only used when primary key record collisions are rejected (UPDATE_ON_EXISTING_PK is FALSE).
If set to TRUE, any record update that is rejected for resulting in a primary key collision with an existing table record will be ignored with no error generated. If FALSE, the rejection of any update for resulting in a primary key collision will cause an error to be reported. If the specified table does not have a primary key or if UPDATE_ON_EXISTING_PK is TRUE, then this option has no effect. Supported values:
- TRUE: Ignore updates that result in primary key collisions with existing records.
- FALSE: Treat as errors any updates that result in primary key collisions with existing records.
The default value is FALSE.
Definition at line 1488 of file UpdateRecords.cs.
◆ RECORD_ID
| static |
ID of a single record to be updated (returned in the call to Kinetica.insertRecords or Kinetica.getRecordsFromCollection).
Definition at line 1592 of file UpdateRecords.cs.
◆ TRUE
| static |
A boolean constant for the RawUpdateRecordsRequest.Options options.
Definition at line 1383 of file UpdateRecords.cs.
◆ TRUNCATE_STRINGS
| static |
◆ UPDATE_ON_EXISTING_PK
| static |
Specifies the record collision policy for updating a table with a primary key.
There are two ways that a record collision can occur.
The first is an “update collision”, which happens when the update changes the value of the updated record’s primary key, and that new primary key already exists as the primary key of another record in the table.
The second is an “insert collision”, which occurs when a given filter in RawUpdateRecordsRequest.expressions finds no records to update, and the alternate insert record given in RawUpdateRecordsRequest.records_to_insert (or records_to_insert_str) contains a primary key matching that of an existing record in the table.
If UPDATE_ON_EXISTING_PK is set to TRUE, “update collisions” will result in the existing record collided into being removed and the record updated with values specified in RawUpdateRecordsRequest.new_values_maps taking its place; “insert collisions” will result in the collided-into record being updated with the values in RawUpdateRecordsRequest.records_to_insert / records_to_insert_str (if given).
If set to FALSE, the existing collided-into record will remain unchanged, while the update will be rejected and the 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:
- TRUE: Overwrite the collided-into record when updating a record’s primary key or inserting an alternate record causes a primary key collision between the record being updated/inserted and another existing record in the table
- FALSE: Reject updates which cause primary key collisions between the record being updated/inserted and an existing record in the table
The default value is FALSE.
Definition at line 1446 of file UpdateRecords.cs.
◆ UPDATE_PARTITION
| static |
Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated.
Supported values:
The default value is FALSE.
Definition at line 1508 of file UpdateRecords.cs.
◆ USE_EXPRESSIONS_IN_NEW_VALUES_MAPS
| static |
When set to TRUE, all new values in RawUpdateRecordsRequest.new_values_maps are considered as expression values.
When set to FALSE, all new values in RawUpdateRecordsRequest.new_values_maps are considered as constants. NOTE: When TRUE, string constants will need to be quoted to avoid being evaluated as expressions. Supported values:
The default value is FALSE.
Definition at line 1585 of file UpdateRecords.cs.
Property Documentation
◆ data
| getset |
An optional list of new binary-avro encoded records to insert, one for each update.
If one of RawUpdateRecordsRequest.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 List.
Definition at line 1623 of file UpdateRecords.cs.
◆ expressions
| getset |
A list of the actual predicates, one for each update; format should follow the guidelines here.
Definition at line 1606 of file UpdateRecords.cs.
◆ new_values_maps
| getset |
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 RawUpdateRecordsRequest.expressions.
Definition at line 1614 of file UpdateRecords.cs.
◆ options
| getset |
Optional parameters.
- GLOBAL_EXPRESSION: An optional global expression to reduce the search space of the predicates listed in RawUpdateRecordsRequest.expressions. The default value is ”.
- BYPASS_SAFETY_CHECKS: When set to TRUE, all predicates are available for primary key updates. Keep in mind that it is possible to destroy data in this case, since a single predicate may match multiple objects (potentially all of records of a table), and then updating all of those records to have the same primary key will, due to the primary key uniqueness constraints, effectively delete all but one of those updated records. Supported values:The default value is FALSE.
- UPDATE_ON_EXISTING_PK: Specifies the record collision policy for updating a table with a primary key. There are two ways that a record collision can occur. The first is an “update collision”, which happens when the update changes the value of the updated record’s primary key, and that new primary key already exists as the primary key of another record in the table. The second is an “insert collision”, which occurs when a given filter in RawUpdateRecordsRequest.expressions finds no records to update, and the alternate insert record given in RawUpdateRecordsRequest.records_to_insert (or
records_to_insert_str) contains a primary key matching that of an existing record in the table. If UPDATE_ON_EXISTING_PK is set to TRUE, “update collisions” will result in the existing record collided into being removed and the record updated with values specified in RawUpdateRecordsRequest.new_values_maps taking its place; “insert collisions” will result in the collided-into record being updated with the values in RawUpdateRecordsRequest.records_to_insert /records_to_insert_str(if given). If set to FALSE, the existing collided-into record will remain unchanged, while the update will be rejected and the 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:- TRUE: Overwrite the collided-into record when updating a record’s primary key or inserting an alternate record causes a primary key collision between the record being updated/inserted and another existing record in the table
- FALSE: Reject updates which cause primary key collisions between the record being updated/inserted and an existing record in the table
- IGNORE_EXISTING_PK: Specifies the record collision error-suppression policy for updating a table with a primary key, only used when primary key record collisions are rejected (UPDATE_ON_EXISTING_PK is FALSE). If set to TRUE, any record update that is rejected for resulting in a primary key collision with an existing table record will be ignored with no error generated. If FALSE, the rejection of any update for resulting in a primary key collision will cause an error to be reported. If the specified table does not have a primary key or if UPDATE_ON_EXISTING_PK is TRUE, then this option has no effect. Supported values:
- TRUE: Ignore updates that result in primary key collisions with existing records.
- FALSE: Treat as errors any updates that result in primary key collisions with existing records.
- UPDATE_PARTITION: Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated. Supported values:The default value is FALSE.
- ENABLE_INPLACE_UPDATES: If set to TRUE, qualifying records are modified in place. If set to FALSE, they are updated by deleting the existing record and inserting a replacement (delete and insert), which prevents the change from being reflected in dependent materialized views until they are refreshed. Supported values:The default value is TRUE.
- TRUNCATE_STRINGS: If set to TRUE, any strings which are too long for their charN string fields will be truncated to fit. Supported values:The default value is FALSE.
- USE_EXPRESSIONS_IN_NEW_VALUES_MAPS: When set to TRUE, all new values in RawUpdateRecordsRequest.new_values_maps are considered as expression values. When set to FALSE, all new values in RawUpdateRecordsRequest.new_values_maps are considered as constants. NOTE: When TRUE, string constants will need to be quoted to avoid being evaluated as expressions. Supported values:The default value is FALSE.
- RECORD_ID: ID of a single record to be updated (returned in the call to Kinetica.insertRecords or Kinetica.getRecordsFromCollection).
The default value is an empty Dictionary.
Definition at line 1896 of file UpdateRecords.cs.
◆ table_name
| getset |
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 1601 of file UpdateRecords.cs.
The documentation for this class was generated from the following files:
- _build/public-os_ubuntu24.04-arch_amd64-cc_gcc_13.3.0/install/Kinetica/Protocol/UpdateRecords.cs
- Kinetica/Protocol/UpdateRecords.cs