> ## 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::RecordRetriever

> gpudb::RecordRetriever — Kinetica C++ API

<div className="kinetica-doxygen">
  <div className="contents">
    <p>The multi-head record retriever class. <a href="#details">More...</a></p>
    <p><code>#include \<<a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">gpudb/RecordRetriever.hpp</a>></code></p>
    <p>Inherits boost::noncopyable.</p>

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

      <tr className="memitem:a222ed086719f41193249f25d47efbdfe" id="r_a222ed086719f41193249f25d47efbdfe">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a222ed086719f41193249f25d47efbdfe">RecordRetriever</a> (const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> \&db, const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> \&record\_type, const std::string \&table\_name, const <a className="el" href="/content/api/cpp/classgpudb_1_1WorkerList">WorkerList</a> \&worker\_list)</td>
      </tr>

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

      <tr className="memitem:a9cd0b8dfdaec2cee9c54db1b1503d9c1" id="r_a9cd0b8dfdaec2cee9c54db1b1503d9c1">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a9cd0b8dfdaec2cee9c54db1b1503d9c1">RecordRetriever</a> (const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> \&db, const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> \&record\_type, const std::string \&table\_name)</td>
      </tr>

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

      <tr className="memitem:ae52cd568ed114076a22ea0d196d59b89" id="r_ae52cd568ed114076a22ea0d196d59b89">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#ae52cd568ed114076a22ea0d196d59b89">RecordRetriever</a> (const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> \&db, const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> \&record\_type, const std::string \&table\_name, const <a className="el" href="/content/api/cpp/classgpudb_1_1WorkerList">WorkerList</a> \&worker\_list, const std::map\< std::string, std::string > \&retrieval\_options)</td>
      </tr>

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

      <tr className="memitem:a326302d02387dc45dc7d4de38aa7a805" id="r_a326302d02387dc45dc7d4de38aa7a805">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a326302d02387dc45dc7d4de38aa7a805">RecordRetriever</a> (const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> \&db, const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> \&record\_type, const std::string \&table\_name, const std::map\< std::string, std::string > \&retrieval\_options)</td>
      </tr>

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

      <tr className="memitem:ace89fc6c6270fb3887446f3a8b473edf" id="r_ace89fc6c6270fb3887446f3a8b473edf">
        <td className="memItemLeft" align="right" valign="top"> </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#ace89fc6c6270fb3887446f3a8b473edf">\~RecordRetriever</a> ()</td>
      </tr>

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

      <tr className="memitem:a770a90b25585984e02973616667468ba" id="r_a770a90b25585984e02973616667468ba">
        <td className="memItemLeft" align="right" valign="top">const std::string & </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a770a90b25585984e02973616667468ba">getTableName</a> () const</td>
      </tr>

      <tr className="memdesc:a770a90b25585984e02973616667468ba">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Returns the name of the table on which this class operates. <br /></td>
      </tr>

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

      <tr className="memitem:ab5e9ef169e265b87ad7574834e7b891f" id="r_ab5e9ef169e265b87ad7574834e7b891f">
        <td className="memItemLeft" align="right" valign="top">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> & </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#ab5e9ef169e265b87ad7574834e7b891f">getGPUdb</a> () const</td>
      </tr>

      <tr className="memdesc:ab5e9ef169e265b87ad7574834e7b891f">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Returns the <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">GPUdb</a> client handle that this class uses internally. <br /></td>
      </tr>

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

      <tr className="memitem:a167490f5a5d1615d66d15028d734792f" id="r_a167490f5a5d1615d66d15028d734792f">
        <td className="memItemLeft" align="right" valign="top">const std::map\< std::string, std::string > & </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a167490f5a5d1615d66d15028d734792f">getOptions</a> () const</td>
      </tr>

      <tr className="memdesc:a167490f5a5d1615d66d15028d734792f">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Gets the options currently used for the retriever methods. <br /></td>
      </tr>

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

      <tr className="memitem:a8bf0df54ab0fc4351680b9ac8f1f0aca" id="r_a8bf0df54ab0fc4351680b9ac8f1f0aca">
        <td className="memItemLeft" align="right" valign="top">void </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a8bf0df54ab0fc4351680b9ac8f1f0aca">setOptions</a> (const std::map\< std::string, std::string > \&options)</td>
      </tr>

      <tr className="memdesc:a8bf0df54ab0fc4351680b9ac8f1f0aca">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Returns the options currently used for the retriever methods. <br /></td>
      </tr>

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

      <tr className="memitem:a45a8879d5112b7dd11608a3a2b6afd83" id="r_a45a8879d5112b7dd11608a3a2b6afd83">
        <td className="memItemLeft" align="right" valign="top"><a className="el" href="/content/api/cpp/structgpudb_1_1GetRecordsResponse">GetRecordsResponse</a>\< <a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">gpudb::GenericRecord</a> > </td>
        <td className="memItemRight" valign="bottom"><a className="el" href="#a45a8879d5112b7dd11608a3a2b6afd83">getRecordsByKey</a> (const <a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">gpudb::GenericRecord</a> \&record, const std::string \&expression="")</td>
      </tr>

      <tr className="memdesc:a45a8879d5112b7dd11608a3a2b6afd83">
        <td className="mdescLeft"> </td>
        <td className="mdescRight">Retrieves records for a shard key, based on the shard key values populated in the given <code><a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">GenericRecord</a></code>; optionally, further limited by an additional expression. <br /></td>
      </tr>

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

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

    <div className="textblock">
      <p>The multi-head record retriever class. </p>
      <p>Using this class is significantly more computation-intensive compared to a regular insertion. So, it is highly recommended to use this ingestor only if multi-head ingestion is actually turned on in the server and there is a large volume of records to be inserted.</p>
      <p>Also, for now, only key-lookup is available via this class, meaning, the user has to supply the values for all the shard columns via the get\_records\_by\_key() method; also, this method does not support unsharded tables. </p>
      <p className="definition">Definition at line <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source#l00037">37</a> of file <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">RecordRetriever.hpp</a>.</p>
    </div>

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

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">gpudb::RecordRetriever::RecordRetriever </td>
            <td>(</td>
            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">db</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">record\_type</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">table\_name</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1WorkerList">WorkerList</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">worker\_list</span></span> )</td>
          </tr>
        </table>
      </div>

      <div className="memdoc" />
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a9cd0b8dfdaec2cee9c54db1b1503d9c1">◆ </a></span>RecordRetriever() <span className="overload">\[2/4]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">gpudb::RecordRetriever::RecordRetriever </td>
            <td>(</td>
            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">db</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">record\_type</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">table\_name</span></span> )</td>
          </tr>
        </table>
      </div>

      <div className="memdoc" />
    </div>

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

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">gpudb::RecordRetriever::RecordRetriever </td>
            <td>(</td>
            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">db</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">record\_type</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">table\_name</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1WorkerList">WorkerList</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">worker\_list</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">retrieval\_options</span></span> )</td>
          </tr>
        </table>
      </div>

      <div className="memdoc" />
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a326302d02387dc45dc7d4de38aa7a805">◆ </a></span>RecordRetriever() <span className="overload">\[4/4]</span></h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">gpudb::RecordRetriever::RecordRetriever </td>
            <td>(</td>
            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">db</span></span>, </td>
          </tr>

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

            <td />

            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1Type">gpudb::Type</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">record\_type</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">table\_name</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">retrieval\_options</span></span> )</td>
          </tr>
        </table>
      </div>

      <div className="memdoc" />
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#ace89fc6c6270fb3887446f3a8b473edf">◆ </a></span>\~RecordRetriever()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">gpudb::RecordRetriever::\~RecordRetriever </td>
            <td>(</td>

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

            <td>)</td>

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

      <div className="memdoc" />
    </div>

    <h2 className="groupheader">Member Function Documentation</h2>
    <h2 className="memtitle"><span className="permalink"><a href="#ab5e9ef169e265b87ad7574834e7b891f">◆ </a></span>getGPUdb()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">const <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">gpudb::GPUdb</a> & gpudb::RecordRetriever::getGPUdb </td>
                  <td>(</td>

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

                  <td>)</td>
                  <td> const</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>Returns the <a className="el" href="/content/api/cpp/classgpudb_1_1GPUdb">GPUdb</a> client handle that this class uses internally. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source#l00069">69</a> of file <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">RecordRetriever.hpp</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a167490f5a5d1615d66d15028d734792f">◆ </a></span>getOptions()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">const std::map\< std::string, std::string > & gpudb::RecordRetriever::getOptions </td>
                  <td>(</td>

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

                  <td>)</td>
                  <td> const</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>Gets the options currently used for the retriever methods. </p>
        <p>Note that any <a className="el" href="/content/api/cpp/namespacegpudb#a40c38c510dc7a5c6e33feeee54b47ce0">gpudb::get\_records\_by\_column\_expression</a> option will get overridden at the next <code><a className="el" href="#a45a8879d5112b7dd11608a3a2b6afd83">getRecordsByKey</a></code> call with the appropriate expression. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source#l00079">79</a> of file <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">RecordRetriever.hpp</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a45a8879d5112b7dd11608a3a2b6afd83">◆ </a></span>getRecordsByKey()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1GetRecordsResponse">GetRecordsResponse</a>\< <a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">gpudb::GenericRecord</a> > gpudb::RecordRetriever::getRecordsByKey </td>
            <td>(</td>
            <td className="paramtype">const <a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">gpudb::GenericRecord</a> &</td>
            <td className="paramname"><span className="paramname"><span className="em">record</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">expression</span></span><span className="paramdefsep"> = </span><span className="paramdefval">""</span> )</td>
          </tr>
        </table>
      </div>

      <div className="memdoc">
        <p>Retrieves records for a shard key, based on the shard key values populated in the given <code><a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">GenericRecord</a></code>; optionally, further limited by an additional expression. </p>
        <p>All records matching the key and satisfying the expression will be returned, up to the system-defined limit. For multi-head mode the request will be sent directly to the appropriate worker. </p>
        <p>All fields in both the shard key and the expression must have defined attribute indexes, unless the shard key is also a primary key and all referenced fields are in the primary key. The expression must be limited to basic equality and inequality comparisons that can be evaluated using the attribute indexes.</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">record</td>
                <td>A <code><a className="el" href="/content/api/cpp/classgpudb_1_1GenericRecord">GenericRecord</a></code> containing a mapping of the shard column values to use in the lookup. </td>
              </tr>

              <tr>
                <td className="paramdir">\[in]</td>
                <td className="paramname">expression</td>
                <td>An optional expression. Default is an empty string.</td>
              </tr>
            </table>
          </div>
        </div>

        <div className="dl section return">
          <div className="dt">Returns</div>

          <div className="dd" />
        </div>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a770a90b25585984e02973616667468ba">◆ </a></span>getTableName()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="mlabels">
          <tr>
            <td className="mlabels-left">
              <table className="memname">
                <tr>
                  <td className="memname">const std::string & gpudb::RecordRetriever::getTableName </td>
                  <td>(</td>

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

                  <td>)</td>
                  <td> const</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>Returns the name of the table on which this class operates. </p>
        <p className="definition">Definition at line <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source#l00064">64</a> of file <a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">RecordRetriever.hpp</a>.</p>
      </div>
    </div>

    <h2 className="memtitle"><span className="permalink"><a href="#a8bf0df54ab0fc4351680b9ac8f1f0aca">◆ </a></span>setOptions()</h2>

    <div className="memitem">
      <div className="memproto">
        <table className="memname">
          <tr>
            <td className="memname">void gpudb::RecordRetriever::setOptions </td>
            <td>(</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>
            <td>)</td>

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

      <div className="memdoc">
        <p>Returns the options currently used for the retriever methods. </p>
        <p>Note that any <a className="el" href="/content/api/cpp/namespacegpudb#a40c38c510dc7a5c6e33feeee54b47ce0">gpudb::get\_records\_by\_column\_expression</a> option will be overridden at the next <code><a className="el" href="#a45a8879d5112b7dd11608a3a2b6afd83">getRecordsByKey</a></code> call with the appropriate expression. </p>
      </div>
    </div>

    <hr />

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

    <ul>
      <li>gpudb/<a className="el" href="/content/api/cpp/RecordRetriever_8hpp_source">RecordRetriever.hpp</a></li>
    </ul>
  </div>
</div>
