> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# gpudb::RawUpdateRecordsRequest

> gpudb::RawUpdateRecordsRequest — Kinetica C++ API

<div className="kinetica-doxygen">
  <div className="contents">
    <p>A set of parameters for <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#afa5f0d470237751f291fc535cff990e7">GPUdb::updateRecordsRaw</a>. <a href="#details">More...</a></p>
    <p><code>#include \<<a className="el" href="/content/api/cpp/update__records_8h_source">gpudb/protocol/update\_records.h</a>></code></p>

    <table className="memberdecls">
      <tr className="heading">
        <td colSpan="2">
          <h2 className="groupheader"> Public Member Functions</h2>
        </td>
      </tr>

      <tr className="memitem:af1ac6c42032ea4450364e7a43976d790" id="r_af1ac6c42032ea4450364e7a43976d790">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#af1ac6c42032ea4450364e7a43976d790">RawUpdateRecordsRequest</a> ()</td>
      </tr>

      <tr className="memdesc:af1ac6c42032ea4450364e7a43976d790">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with default parameters. <br /></td>
      </tr>

      <tr className="separator:af1ac6c42032ea4450364e7a43976d790">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:af88d9df25b651604fa07d406b0dbad65" id="r_af88d9df25b651604fa07d406b0dbad65">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#af88d9df25b651604fa07d406b0dbad65">RawUpdateRecordsRequest</a> (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\_)</td>
      </tr>

      <tr className="memdesc:af88d9df25b651604fa07d406b0dbad65">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with the specified parameters. <br /></td>
      </tr>

      <tr className="separator:af88d9df25b651604fa07d406b0dbad65">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a9ed9cb1c0c27f656b44aa324e0b53334" id="r_a9ed9cb1c0c27f656b44aa324e0b53334">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a9ed9cb1c0c27f656b44aa324e0b53334">RawUpdateRecordsRequest</a> (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\_)</td>
      </tr>

      <tr className="memdesc:a9ed9cb1c0c27f656b44aa324e0b53334">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with the specified parameters. <br /></td>
      </tr>

      <tr className="separator:a9ed9cb1c0c27f656b44aa324e0b53334">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>
    </table>

    <table className="memberdecls">
      <tr className="heading">
        <td colSpan="2">
          <h2 className="groupheader"> Public Attributes</h2>
        </td>
      </tr>

      <tr className="memitem:aa500a4b3c2eea89cb574d4610d0cd642" id="r_aa500a4b3c2eea89cb574d4610d0cd642">
        <td className="memItemLeft" align="right" valign="top">std::string </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#aa500a4b3c2eea89cb574d4610d0cd642">tableName</a></td>
      </tr>

      <tr className="memdesc:aa500a4b3c2eea89cb574d4610d0cd642">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Name of table to be updated, in \[ schema\_name. ]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. <br /></td>
      </tr>

      <tr className="separator:aa500a4b3c2eea89cb574d4610d0cd642">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a031d78b85f296b946451f91c739b23e7" id="r_a031d78b85f296b946451f91c739b23e7">
        <td className="memItemLeft" align="right" valign="top">std::vector\< std::string > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a031d78b85f296b946451f91c739b23e7">expressions</a></td>
      </tr>

      <tr className="memdesc:a031d78b85f296b946451f91c739b23e7">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">A list of the actual predicates, one for each update; format should follow the guidelines <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ad975f31cd9d87d805ebb0513f652eca6">here</a>. <br /></td>
      </tr>

      <tr className="separator:a031d78b85f296b946451f91c739b23e7">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a08649327276a2c1ecfef5f0a574e4a95" id="r_a08649327276a2c1ecfef5f0a574e4a95">
        <td className="memItemLeft" align="right" valign="top">std::vector\< std::map\< std::string, boost::optional\< std::string > > > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a></td>
      </tr>

      <tr className="memdesc:a08649327276a2c1ecfef5f0a574e4a95">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">List of new values for the matching records. <br /></td>
      </tr>

      <tr className="separator:a08649327276a2c1ecfef5f0a574e4a95">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a23c7df2a854b5f84f5ac489843c0f4fc" id="r_a23c7df2a854b5f84f5ac489843c0f4fc">
        <td className="memItemLeft" align="right" valign="top">std::vector\< std::vector\< uint8\_t > > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a23c7df2a854b5f84f5ac489843c0f4fc">recordsToInsert</a></td>
      </tr>

      <tr className="memdesc:a23c7df2a854b5f84f5ac489843c0f4fc">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">An <span className="em">optional</span> list of new binary-avro encoded records to insert, one for each update. <br /></td>
      </tr>

      <tr className="separator:a23c7df2a854b5f84f5ac489843c0f4fc">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a0710eccfd30460f5f136873a07483ec9" id="r_a0710eccfd30460f5f136873a07483ec9">
        <td className="memItemLeft" align="right" valign="top">std::vector\< std::string > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a0710eccfd30460f5f136873a07483ec9">recordsToInsertStr</a></td>
      </tr>

      <tr className="memdesc:a0710eccfd30460f5f136873a07483ec9">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">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. <br /></td>
      </tr>

      <tr className="separator:a0710eccfd30460f5f136873a07483ec9">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:aaba84a2e58dba662c53606c5253a082a" id="r_aaba84a2e58dba662c53606c5253a082a">
        <td className="memItemLeft" align="right" valign="top">std::string </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#aaba84a2e58dba662c53606c5253a082a">recordEncoding</a></td>
      </tr>

      <tr className="memdesc:aaba84a2e58dba662c53606c5253a082a">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Identifies which of <a className="el" href="#a23c7df2a854b5f84f5ac489843c0f4fc">recordsToInsert</a> and <a className="el" href="#a0710eccfd30460f5f136873a07483ec9">recordsToInsertStr</a> should be used. <br /></td>
      </tr>

      <tr className="separator:aaba84a2e58dba662c53606c5253a082a">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>

      <tr className="memitem:a1414565b5a00d5872f69b34a4b37abac" id="r_a1414565b5a00d5872f69b34a4b37abac">
        <td className="memItemLeft" align="right" valign="top">std::map\< std::string, std::string > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a1414565b5a00d5872f69b34a4b37abac">options</a></td>
      </tr>

      <tr className="memdesc:a1414565b5a00d5872f69b34a4b37abac">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Optional parameters. <br /></td>
      </tr>

      <tr className="separator:a1414565b5a00d5872f69b34a4b37abac">
        <td className="memSeparator" colSpan="2"> </td>
      </tr>
    </table>

    <h2 className="groupheader">Detailed Description</h2>

    <div className="textblock">
      <p>A set of parameters for <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#afa5f0d470237751f291fc535cff990e7">GPUdb::updateRecordsRaw</a>. </p>
      <p>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 <a className="el" href="#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a>. 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.</p>
      <p>Note that this operation can only be run on an original table and not on a result view.</p>
      <p>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 <a className="el" href="#a1414565b5a00d5872f69b34a4b37abac">options</a>.</p>
      <p>The <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> option specifies the record primary key collision policy for tables with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, while <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a> 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. </p>
      <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00046">46</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
    </div>

    <h2 className="groupheader">Constructor & Destructor Documentation</h2>
    <h2 className="memtitle"><span className="permalink"><a href="#af1ac6c42032ea4450364e7a43976d790">◆ </a></span>RawUpdateRecordsRequest() <span className="overload">\[1/3]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">gpudb::RawUpdateRecordsRequest::RawUpdateRecordsRequest </td>
                  <td>(</td>

                  <td className="paramname">
                    <span className="paramname">
                      <span className="em" />
                    </span>
                  </td>

                  <td>)</td>

                  <td />
                </tr>
              </table>
            </td>

            <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with default parameters. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00051">51</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#af88d9df25b651604fa07d406b0dbad65">◆ </a></span>RawUpdateRecordsRequest() <span className="overload">\[2/3]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">gpudb::RawUpdateRecordsRequest::RawUpdateRecordsRequest </td>
                  <td>(</td>
                  <td className="paramtype">const std::string &</td>
                  <td className="paramname"><span className="paramname"><span className="em">tableName\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">expressions\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::map\< std::string, boost::optional\< std::string > > > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">newValuesMaps\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::vector\< uint8\_t > > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">recordsToInsert\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::map\< std::string, std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">options\_</span></span> )</td>
                </tr>
              </table>
            </td>

            <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with the specified parameters. </p>

        <div className="dl params">
          <div className="dt">Parameters</div>

          <div className="dd">
            <table className="params">
              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">tableName\_</td>
                <td>Name of table to be updated, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be a currently existing table and not a view. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">expressions\_</td>
                <td>A list of the actual predicates, one for each update; format should follow the guidelines <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ad975f31cd9d87d805ebb0513f652eca6">here</a>. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">newValuesMaps\_</td>
                <td>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 <span className="em arg">expressions\_</span>. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">recordsToInsert\_</td>
                <td>An <span className="em">optional</span> list of new binary-avro encoded records to insert, one for each update. If one of <span className="em arg">expressions\_</span> 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. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">options\_</td>

                <td>
                  Optional parameters.

                  <ul>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#afcbdcbe97048f032546d0d11edf6c365">update\_records\_global\_expression</a>: An optional global expression to reduce the search space of the predicates listed in <span className="em arg">expressions\_</span>. The default value is ''. </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a3b69b89e59b979d4b18cb472ac74e3f7">update\_records\_bypass\_safety\_checks</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_records\_update\_on\_existing\_pk</a>: Specifies the record collision policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>. 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 <span className="em arg">expressions\_</span> finds no records to update, and the alternate insert record given in <span className="em arg">recordsToInsert\_</span> (or <span className="em arg">recordsToInsertStr\_</span>) contains a primary key matching that of an existing record in the table. If <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, "update collisions" will result in the existing record collided into being removed and the record updated with values specified in <span className="em arg">newValuesMaps\_</span> taking its place; "insert collisions" will result in the collided-into record being updated with the values in <span className="em arg">recordsToInsert\_</span> / <span className="em arg">recordsToInsertStr\_</span> (if given). If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, the existing collided-into record will remain unchanged, while the update will be rejected and the error handled as determined by <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a>. If the specified table does not have a primary key, then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: 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 </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Reject updates which cause primary key collisions between the record being updated/inserted and an existing record in the table </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">update\_records\_ignore\_existing\_pk</a>: Specifies the record collision error-suppression policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, only used when primary key record collisions are rejected (<a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: Ignore updates that result in primary key collisions with existing records. </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Treat as errors any updates that result in primary key collisions with existing records. </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a8563f5f0f820e418db2f279f6e50ed46">update\_records\_update\_partition</a>: Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a867bf5271cecb6a47d7254dd0a2a80e6">update\_records\_enable\_inplace\_updates</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, qualifying records are modified in place. If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#add7d9885f8ee4c8626ca1382f1f2b693">update\_records\_truncate\_strings</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, any strings which are too long for their charN string fields will be truncated to fit. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#acb63acfa8b6cde789b126ee99561d5de">update\_records\_use\_expressions\_in\_new\_values\_maps</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, all new values in <span className="em arg">newValuesMaps\_</span> are considered as expression values. When set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, all new values in <span className="em arg">newValuesMaps\_</span> are considered as constants. NOTE: When <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, string constants will need to be quoted to avoid being evaluated as expressions. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7e44ada8bf08b366e29972017837ba70">update\_records\_record\_id</a>: ID of a single record to be updated (returned in the call to <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a1ec81d92f949358379266d42ae12bae7">GPUdb::insertRecordsRaw</a> or <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a15a7bd6a0d065b5528141f8e00a91305">GPUdb::getRecordsFromCollectionRaw</a>). </li>
                  </ul>

                  The default value is an empty map.
                </td>
              </tr>
            </table>
          </div>
        </div>

        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00341">341</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a9ed9cb1c0c27f656b44aa324e0b53334">◆ </a></span>RawUpdateRecordsRequest() <span className="overload">\[3/3]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">gpudb::RawUpdateRecordsRequest::RawUpdateRecordsRequest </td>
                  <td>(</td>
                  <td className="paramtype">const std::string &</td>
                  <td className="paramname"><span className="paramname"><span className="em">tableName\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">expressions\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::map\< std::string, boost::optional\< std::string > > > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">newValuesMaps\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::vector\< uint8\_t > > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">recordsToInsert\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::vector\< std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">recordsToInsertStr\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::string &</td>
                  <td className="paramname"><span className="paramname"><span className="em">recordEncoding\_</span></span>, </td>
                </tr>

                <tr>
                  <td className="paramkey" />

                  <td />

                  <td className="paramtype">const std::map\< std::string, std::string > &</td>
                  <td className="paramname"><span className="paramname"><span className="em">options\_</span></span> )</td>
                </tr>
              </table>
            </td>

            <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Constructs a <a className="el" href="/content/api/cpp/structgpudb_1_1RawUpdateRecordsRequest" title="A set of parameters for GPUdb::updateRecordsRaw.">RawUpdateRecordsRequest</a> object with the specified parameters. </p>

        <div className="dl params">
          <div className="dt">Parameters</div>

          <div className="dd">
            <table className="params">
              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">tableName\_</td>
                <td>Name of table to be updated, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. Must be a currently existing table and not a view. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">expressions\_</td>
                <td>A list of the actual predicates, one for each update; format should follow the guidelines <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ad975f31cd9d87d805ebb0513f652eca6">here</a>. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">newValuesMaps\_</td>
                <td>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 <span className="em arg">expressions\_</span>. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">recordsToInsert\_</td>
                <td>An <span className="em">optional</span> list of new binary-avro encoded records to insert, one for each update. If one of <span className="em arg">expressions\_</span> 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. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">recordsToInsertStr\_</td>
                <td>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. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">recordEncoding\_</td>

                <td>
                  Identifies which of <span className="em arg">recordsToInsert\_</span> and <span className="em arg">recordsToInsertStr\_</span> should be used. Supported values:

                  <ul>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a575235660b98ca97defbf3e99011182a">update\_records\_binary</a> </li>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#ade011c735985af5ff567320f4c991435">update\_records\_json</a> </li>
                  </ul>

                  The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a575235660b98ca97defbf3e99011182a">update\_records\_binary</a>.
                </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">options\_</td>

                <td>
                  Optional parameters.

                  <ul>
                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#afcbdcbe97048f032546d0d11edf6c365">update\_records\_global\_expression</a>: An optional global expression to reduce the search space of the predicates listed in <span className="em arg">expressions\_</span>. The default value is ''. </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a3b69b89e59b979d4b18cb472ac74e3f7">update\_records\_bypass\_safety\_checks</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_records\_update\_on\_existing\_pk</a>: Specifies the record collision policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>. 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 <span className="em arg">expressions\_</span> finds no records to update, and the alternate insert record given in <span className="em arg">recordsToInsert\_</span> (or <span className="em arg">recordsToInsertStr\_</span>) contains a primary key matching that of an existing record in the table. If <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, "update collisions" will result in the existing record collided into being removed and the record updated with values specified in <span className="em arg">newValuesMaps\_</span> taking its place; "insert collisions" will result in the collided-into record being updated with the values in <span className="em arg">recordsToInsert\_</span> / <span className="em arg">recordsToInsertStr\_</span> (if given). If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, the existing collided-into record will remain unchanged, while the update will be rejected and the error handled as determined by <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a>. If the specified table does not have a primary key, then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: 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 </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Reject updates which cause primary key collisions between the record being updated/inserted and an existing record in the table </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">update\_records\_ignore\_existing\_pk</a>: Specifies the record collision error-suppression policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, only used when primary key record collisions are rejected (<a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, then this option has no effect. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: Ignore updates that result in primary key collisions with existing records. </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Treat as errors any updates that result in primary key collisions with existing records. </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a8563f5f0f820e418db2f279f6e50ed46">update\_records\_update\_partition</a>: Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#a867bf5271cecb6a47d7254dd0a2a80e6">update\_records\_enable\_inplace\_updates</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, qualifying records are modified in place. If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#add7d9885f8ee4c8626ca1382f1f2b693">update\_records\_truncate\_strings</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, any strings which are too long for their charN string fields will be truncated to fit. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li>
                      <a className="el" href="/content/api/cpp/namespacegpudb#acb63acfa8b6cde789b126ee99561d5de">update\_records\_use\_expressions\_in\_new\_values\_maps</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, all new values in <span className="em arg">newValuesMaps\_</span> are considered as expression values. When set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, all new values in <span className="em arg">newValuesMaps\_</span> are considered as constants. NOTE: When <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, string constants will need to be quoted to avoid being evaluated as expressions. Supported values:

                      <ul>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
                        <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
                      </ul>

                      The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
                    </li>

                    <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7e44ada8bf08b366e29972017837ba70">update\_records\_record\_id</a>: ID of a single record to be updated (returned in the call to <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a1ec81d92f949358379266d42ae12bae7">GPUdb::insertRecordsRaw</a> or <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a15a7bd6a0d065b5528141f8e00a91305">GPUdb::getRecordsFromCollectionRaw</a>). </li>
                  </ul>

                  The default value is an empty map.
                </td>
              </tr>
            </table>
          </div>
        </div>

        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00651">651</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="groupheader">Member Data Documentation</h2>
    <h2 className="memtitle"><span className="permalink"><a href="#a031d78b85f296b946451f91c739b23e7">◆ </a></span>expressions</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::vector\<std::string> gpudb::RawUpdateRecordsRequest::expressions</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>A list of the actual predicates, one for each update; format should follow the guidelines <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#ad975f31cd9d87d805ebb0513f652eca6">here</a>. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00676">676</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a08649327276a2c1ecfef5f0a574e4a95">◆ </a></span>newValuesMaps</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::vector\<std::map\<std::string, boost::optional\<std::string> > > gpudb::RawUpdateRecordsRequest::newValuesMaps</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>List of new values for the matching records. </p>
        <p>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 <a className="el" href="#a031d78b85f296b946451f91c739b23e7">expressions</a>. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00685">685</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a1414565b5a00d5872f69b34a4b37abac">◆ </a></span>options</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::map\<std::string, std::string> gpudb::RawUpdateRecordsRequest::options</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Optional parameters. </p>

        <ul>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#afcbdcbe97048f032546d0d11edf6c365">update\_records\_global\_expression</a>: An optional global expression to reduce the search space of the predicates listed in <a className="el" href="#a031d78b85f296b946451f91c739b23e7">expressions</a>. The default value is ''. </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a3b69b89e59b979d4b18cb472ac74e3f7">update\_records\_bypass\_safety\_checks</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_records\_update\_on\_existing\_pk</a>: Specifies the record collision policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>. 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 <a className="el" href="#a031d78b85f296b946451f91c739b23e7">expressions</a> finds no records to update, and the alternate insert record given in <a className="el" href="#a23c7df2a854b5f84f5ac489843c0f4fc">recordsToInsert</a> (or <a className="el" href="#a0710eccfd30460f5f136873a07483ec9">recordsToInsertStr</a>) contains a primary key matching that of an existing record in the table. If <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, "update collisions" will result in the existing record collided into being removed and the record updated with values specified in <a className="el" href="#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a> taking its place; "insert collisions" will result in the collided-into record being updated with the values in <a className="el" href="#a23c7df2a854b5f84f5ac489843c0f4fc">recordsToInsert</a> / <a className="el" href="#a0710eccfd30460f5f136873a07483ec9">recordsToInsertStr</a> (if given). If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, the existing collided-into record will remain unchanged, while the update will be rejected and the error handled as determined by <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">ignore\_existing\_pk</a>. If the specified table does not have a primary key, then this option has no effect. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: 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 </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Reject updates which cause primary key collisions between the record being updated/inserted and an existing record in the table </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#aba9511e40d021bad06b9dc8680f20ded">update\_records\_ignore\_existing\_pk</a>: Specifies the record collision error-suppression policy for updating a table with a <a href="/content/concepts/tables/#primary-keys" target="_top">primary key</a>, only used when primary key record collisions are rejected (<a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>). If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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 <a className="el" href="/content/api/cpp/namespacegpudb#a7605a7a3a0274ce44efaa471344dcef2">update\_on\_existing\_pk</a> is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, then this option has no effect. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>: Ignore updates that result in primary key collisions with existing records. </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>: Treat as errors any updates that result in primary key collisions with existing records. </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a8563f5f0f820e418db2f279f6e50ed46">update\_records\_update\_partition</a>: Force qualifying records to be deleted and reinserted so their partition membership will be reevaluated. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#a867bf5271cecb6a47d7254dd0a2a80e6">update\_records\_enable\_inplace\_updates</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, qualifying records are modified in place. If set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, 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:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#add7d9885f8ee4c8626ca1382f1f2b693">update\_records\_truncate\_strings</a>: If set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, any strings which are too long for their charN string fields will be truncated to fit. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li>
            <a className="el" href="/content/api/cpp/namespacegpudb#acb63acfa8b6cde789b126ee99561d5de">update\_records\_use\_expressions\_in\_new\_values\_maps</a>: When set to <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, all new values in <a className="el" href="#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a> are considered as expression values. When set to <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">false</a>, all new values in <a className="el" href="#a08649327276a2c1ecfef5f0a574e4a95">newValuesMaps</a> are considered as constants. NOTE: When <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">true</a>, string constants will need to be quoted to avoid being evaluated as expressions. Supported values:

            <ul>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#a285c1caa5b443115c8d8f7c8638740e6">update\_records\_true</a> </li>
              <li> <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a> </li>
            </ul>

            The default value is <a className="el" href="/content/api/cpp/namespacegpudb#abb0d038b0eefbedd53545f6ec7e312b6">update\_records\_false</a>.
          </li>

          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7e44ada8bf08b366e29972017837ba70">update\_records\_record\_id</a>: ID of a single record to be updated (returned in the call to <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a1ec81d92f949358379266d42ae12bae7">GPUdb::insertRecordsRaw</a> or <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb#a15a7bd6a0d065b5528141f8e00a91305">GPUdb::getRecordsFromCollectionRaw</a>). </li>
        </ul>

        <p>The default value is an empty map. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00889">889</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#aaba84a2e58dba662c53606c5253a082a">◆ </a></span>recordEncoding</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::string gpudb::RawUpdateRecordsRequest::recordEncoding</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Identifies which of <a className="el" href="#a23c7df2a854b5f84f5ac489843c0f4fc">recordsToInsert</a> and <a className="el" href="#a0710eccfd30460f5f136873a07483ec9">recordsToInsertStr</a> should be used. </p>
        <p>Supported values: </p>

        <ul>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#a575235660b98ca97defbf3e99011182a">update\_records\_binary</a> </li>
          <li> <a className="el" href="/content/api/cpp/namespacegpudb#ade011c735985af5ff567320f4c991435">update\_records\_json</a> </li>
        </ul>

        <p>The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a575235660b98ca97defbf3e99011182a">update\_records\_binary</a>. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00714">714</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a23c7df2a854b5f84f5ac489843c0f4fc">◆ </a></span>recordsToInsert</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::vector\<std::vector\<uint8\_t> > gpudb::RawUpdateRecordsRequest::recordsToInsert</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>An <span className="em">optional</span> list of new binary-avro encoded records to insert, one for each update. </p>
        <p>If one of <a className="el" href="#a031d78b85f296b946451f91c739b23e7">expressions</a> 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. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00694">694</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a0710eccfd30460f5f136873a07483ec9">◆ </a></span>recordsToInsertStr</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::vector\<std::string> gpudb::RawUpdateRecordsRequest::recordsToInsertStr</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>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. </p>
        <p>The default value is an empty vector. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00701">701</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#aa500a4b3c2eea89cb574d4610d0cd642">◆ </a></span>tableName</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">std::string gpudb::RawUpdateRecordsRequest::tableName</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Name of table to be updated, in \[ schema\_name. ]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. </p>
        <p>Must be a currently existing table and not a view. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/update__records_8h_source#l00669">669</a> of file <a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a>.</p>
      </div>
    </div>

    <hr />

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

    <ul>
      <li>gpudb/protocol/<a className="el" href="/content/api/cpp/update__records_8h_source">update\_records.h</a></li>
    </ul>
  </div>
</div>
