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

# getRecords

<div className="kinetica-javadoc">
  <ul className="member-list">
    <li>
      <div className="section detail" id="getRecords(java.lang.Object,com.gpudb.protocol.GetRecordsRequest)">
        <h3>getRecords</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="type-parameters">\<TResponse></span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol">GetRecordsResponse</a>\<TResponse></span> <span className="element-name">getRecords</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" className="external-link">Object</a> typeDescriptor, <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest" title="class in com.gpudb.protocol">GetRecordsRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>

        <div className="block">
          Retrieves records from a given table, optionally filtered by an expression and/or sorted by a column. This operation can be performed on tables and views. Records can be returned encoded as binary, json, or geojson.
          <p> This operation supports paging through the data via the <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest#getOffset()"><code>offset</code></a> and <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest#getLimit()"><code>limit</code></a> parameters. Note that when paging through a table, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records retrieved may differ between calls based on the updates applied.</p>
        </div>

        <div className="dl notes">
          <div className="dt">Type Parameters:</div>
          <div className="dd"><code>TResponse</code> - The type of object being retrieved.</div>
          <div className="dt">Parameters:</div>
          <div className="dd"><code>typeDescriptor</code> - Type descriptor used for decoding returned objects.</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" className="external-link">IllegalArgumentException</a></code> - if <code>typeDescriptor</code> is not an instance of one of the following: <a href="/content/api/java/com/gpudb/Type" title="class in com.gpudb"><code>Type</code></a>, <a href="/content/api/java/com/gpudb/TypeObjectMap" title="class in com.gpudb"><code>TypeObjectMap</code></a>, <code>Schema</code>, or a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" className="external-link"><code>Class</code></a> that implements <code>IndexedRecord</code></div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="getRecords(java.lang.Object,java.lang.String,long,long,java.util.Map)">
        <h3>getRecords</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="type-parameters">\<TResponse></span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol">GetRecordsResponse</a>\<TResponse></span> <span className="element-name">getRecords</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" className="external-link">Object</a> typeDescriptor, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> tableName, long offset, long limit, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>

        <div className="block">
          Retrieves records from a given table, optionally filtered by an expression and/or sorted by a column. This operation can be performed on tables and views. Records can be returned encoded as binary, json, or geojson.
          <p> This operation supports paging through the data via the <code>offset</code> and <code>limit</code> parameters. Note that when paging through a table, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records retrieved may differ between calls based on the updates applied.</p>
        </div>

        <div className="dl notes">
          <div className="dt">Type Parameters:</div>
          <div className="dd"><code>TResponse</code> - The type of object being retrieved.</div>
          <div className="dt">Parameters:</div>
          <div className="dd"><code>typeDescriptor</code> - Type descriptor used for decoding returned objects.</div>
          <div className="dd"><code>tableName</code> - Name of the table or view from which the records will be fetched, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>.</div>
          <div className="dd"><code>offset</code> - 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.</div>
          <div className="dd"><code>limit</code> - 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 href="/content/config/#config-main-general" target="_top">max\_get\_records\_size</a> parameter in the server configuration. Use <a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse#getHasMoreRecords()"><code>hasMoreRecords</code></a> to see if more records exist in the result to be fetched, and <code>offset</code> and <code>limit</code> to request subsequent pages of results. The default value is -9999.</div>

          <div className="dd">
            <code>options</code> -

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#EXPRESSION"><code>EXPRESSION</code></a>: Filter expression to apply to the table. </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#FAST_INDEX_LOOKUP"><code>FAST\_INDEX\_LOOKUP</code></a>: Indicates if indexes should be used to perform the lookup for a given expression if possible. Only applicable if there is no sorting, the expression contains only equivalence comparisons based on existing tables indexes and the range of requested values is from \[0 to END\_OF\_SET]. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#TRUE"><code>TRUE</code></a>.
              </li>

              <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#SORT_BY"><code>SORT\_BY</code></a>: Column that the data should be sorted by. Empty by default (i.e. no sorting is applied). </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#SORT_ORDER"><code>SORT\_ORDER</code></a>: String indicating how the returned values should be sorted - ascending or descending. If sort\_order is provided, sort\_by has to be provided. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#ASCENDING"><code>ASCENDING</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#DESCENDING"><code>DESCENDING</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#ASCENDING"><code>ASCENDING</code></a>.
              </li>
            </ul>

            The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.
          </div>

          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" className="external-link">IllegalArgumentException</a></code> - if <code>typeDescriptor</code> is not an instance of one of the following: <a href="/content/api/java/com/gpudb/Type" title="class in com.gpudb"><code>Type</code></a>, <a href="/content/api/java/com/gpudb/TypeObjectMap" title="class in com.gpudb"><code>TypeObjectMap</code></a>, <code>Schema</code>, or a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" className="external-link"><code>Class</code></a> that implements <code>IndexedRecord</code></div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="getRecords(com.gpudb.protocol.GetRecordsRequest)">
        <h3>getRecords</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="type-parameters">\<TResponse></span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol">GetRecordsResponse</a>\<TResponse></span> <span className="element-name">getRecords</span><wbr /><span className="parameters">(<a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest" title="class in com.gpudb.protocol">GetRecordsRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>

        <div className="block">
          Retrieves records from a given table, optionally filtered by an expression and/or sorted by a column. This operation can be performed on tables and views. Records can be returned encoded as binary, json, or geojson.
          <p> This operation supports paging through the data via the <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest#getOffset()"><code>offset</code></a> and <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest#getLimit()"><code>limit</code></a> parameters. Note that when paging through a table, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records retrieved may differ between calls based on the updates applied.</p>
        </div>

        <div className="dl notes">
          <div className="dt">Type Parameters:</div>
          <div className="dd"><code>TResponse</code> - The type of object being retrieved.</div>
          <div className="dt">Parameters:</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="getRecords(java.lang.String,long,long,java.util.Map)">
        <h3>getRecords</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="type-parameters">\<TResponse></span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol">GetRecordsResponse</a>\<TResponse></span> <span className="element-name">getRecords</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> tableName, long offset, long limit, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>

        <div className="block">
          Retrieves records from a given table, optionally filtered by an expression and/or sorted by a column. This operation can be performed on tables and views. Records can be returned encoded as binary, json, or geojson.
          <p> This operation supports paging through the data via the <code>offset</code> and <code>limit</code> parameters. Note that when paging through a table, if the table (or the underlying table in case of a view) is updated (records are inserted, deleted or modified) the records retrieved may differ between calls based on the updates applied.</p>
        </div>

        <div className="dl notes">
          <div className="dt">Type Parameters:</div>
          <div className="dd"><code>TResponse</code> - The type of object being retrieved.</div>
          <div className="dt">Parameters:</div>
          <div className="dd"><code>tableName</code> - Name of the table or view from which the records will be fetched, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>.</div>
          <div className="dd"><code>offset</code> - 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.</div>
          <div className="dd"><code>limit</code> - 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 href="/content/config/#config-main-general" target="_top">max\_get\_records\_size</a> parameter in the server configuration. Use <a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse#getHasMoreRecords()"><code>hasMoreRecords</code></a> to see if more records exist in the result to be fetched, and <code>offset</code> and <code>limit</code> to request subsequent pages of results. The default value is -9999.</div>

          <div className="dd">
            <code>options</code> -

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#EXPRESSION"><code>EXPRESSION</code></a>: Filter expression to apply to the table. </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#FAST_INDEX_LOOKUP"><code>FAST\_INDEX\_LOOKUP</code></a>: Indicates if indexes should be used to perform the lookup for a given expression if possible. Only applicable if there is no sorting, the expression contains only equivalence comparisons based on existing tables indexes and the range of requested values is from \[0 to END\_OF\_SET]. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#TRUE"><code>TRUE</code></a>.
              </li>

              <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#SORT_BY"><code>SORT\_BY</code></a>: Column that the data should be sorted by. Empty by default (i.e. no sorting is applied). </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#SORT_ORDER"><code>SORT\_ORDER</code></a>: String indicating how the returned values should be sorted - ascending or descending. If sort\_order is provided, sort\_by has to be provided. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#ASCENDING"><code>ASCENDING</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#DESCENDING"><code>DESCENDING</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/GetRecordsRequest.Options#ASCENDING"><code>ASCENDING</code></a>.
              </li>
            </ul>

            The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.
          </div>

          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/GetRecordsResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>
  </ul>
</div>
