> ## 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.

# get_records_from_collection_and_decode

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.get_records_from_collection_and_decode"> <span className="sig-name descname"><span className="pre">get\_records\_from\_collection\_and\_decode</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">offset</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">0</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">limit</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">-9999</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">encoding</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">'binary'</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">force\_primitive\_return\_types</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">True</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L31896"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Retrieves records from a collection. The operation can optionally return the record IDs which can be used in certain queries such as <a className="reference internal" href="#gpudb.GPUdb.delete_records" title="gpudb.GPUdb.delete_records"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.delete\_records()</span></code></a>.</p>
      <p>This operation supports paging through the data via the input parameter <span className="em">offset</span> and input parameter <span className="em">limit</span> parameters.</p>
      <p>Note that when using the Java API, it is not possible to retrieve records from join views using this operation. (DEPRECATED)</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the collection or table from which records are to be retrieved, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. Must be an existing collection or table.</p>
            </div>

            <div className="dt">offset (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX\_INT.</p>
            </div>

            <div className="dt">limit (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>A positive integer indicating the maximum number of results to be returned, or END\_OF\_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the <a className="reference external" href="/content/config/#config-main-general">max\_get\_records\_size</a> parameter in the server configuration. Use input parameter <span className="em">offset</span> and input parameter <span className="em">limit</span> to request subsequent pages of results. The default value is -9999.</p>
            </div>

            <div className="dt">encoding (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Specifies the encoding for returned records; either <span className="em">binary</span> or <span className="em">json</span>. Allowed values are:</p>

              <ul className="simple">
                <li>
                  <p>binary</p>
                </li>

                <li>
                  <p>json</p>
                </li>
              </ul>

              <p>The default value is ‘binary’.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>return\_record\_ids</strong> – If <span className="em">true</span> then return the internal record ID along with each returned record. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>expression</strong> – Filter expression to apply to the table. The default value is ‘’.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>

            <div className="dt">force\_primitive\_return\_types (<span className="em">bool</span>) –</div>

            <div className="dd">
              <p>If <span className="cite">True</span>, then <span className="cite">OrderedDict</span> objects will be returned, where string sub-type columns will have their values converted back to strings; for example, the Python <span className="cite">datetime</span> structs, used for datetime type columns would have their values returned as strings. If <span className="cite">False</span>, then <code className="xref py py-class docutils literal notranslate"><span className="pre">Record</span></code> objects will be returned, which for string sub-types, will return native or custom structs; no conversion to string takes place. String conversions, when returning <span className="cite">OrderedDicts</span>, incur a speed penalty, and it is strongly recommended to use the <code className="xref py py-class docutils literal notranslate"><span className="pre">Record</span></code> object option instead. If <span className="cite">True</span>, but none of the returned columns require a conversion, then the original <code className="xref py py-class docutils literal notranslate"><span className="pre">Record</span></code> objects will be returned. Default value is True.</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">table\_name</span>.</p>
            </div>

            <div className="dt">type\_names (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>The type IDs of the corresponding records in output parameter <span className="em">records\_binary</span> or output parameter <span className="em">records\_json</span>. This is useful when input parameter <span className="em">table\_name</span> is a heterogeneous collection (collections containing tables of different types).</p>
            </div>

            <div className="dt">record\_ids (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>If the ‘return\_record\_ids’ option of the request was ‘true’, then this list contains the internal ID for each object. Otherwise it will be empty.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>total\_number\_of\_records</strong> – Total number of records.</p>
                </li>

                <li>
                  <p><strong>has\_more\_records</strong> – Too many records. Returned a partial set. Allowed values are:</p>

                  <ul>
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>

            <div className="dt">records (list of <code className="xref py py-class docutils literal notranslate"><span className="pre">Record</span></code>) –</div>

            <div className="dd">
              <p>A list of <code className="xref py py-class docutils literal notranslate"><span className="pre">Record</span></code> objects which contain the decoded records.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
