Version:

get_records_from_collectionΒΆ

GPUdb.get_records_from_collection( table_name = None, offset = 0, limit = 10000,
                                   encoding = 'binary', options = {} )

Retrieves records from a collection. The operation can optionally return the record IDs which can be used in certain queries such as delete_records.

This operation supports paging through the data via the input parameter offset and input parameter limit parameters.

Note that when using the Java API, it is not possible to retrieve records from join tables using this operation.

Input Parameter Description

Name Type Description
table_name str Name of the collection or table from which records are to be retrieved. Must be an existing collection or table.
offset long A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). Default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.
limit long A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the max number of results should be returned. Default value is 10000.
encoding str

Specifies the encoding for returned records; either 'binary' or 'json'. Default value is 'binary'. The allowed values are:

  • binary
  • json
options dict of str

Default value is an empty dict ( {} ).

Supported Parameters (keys) Parameter Description
return_record_ids

If 'true' then return the internal record ID along with each returned record. Default is 'false'. Default value is 'false'. The allowed values are:

  • True
  • False

Output Parameter Description

Name Type Description
table_name str Value of input parameter table_name.
type_names list of str The type IDs of the corresponding records in output parameter records_binary or output parameter records_json. This is useful when input parameter table_name is a heterogeneous collection (collections containing tables of different types).
records_binary list of str If the encoding parameter of the request was 'binary' then this list contains the binary encoded records retrieved from the table/collection. Otherwise, empty list.
records_json list of str If the encoding parameter of the request was 'json', then this list contains the JSON encoded records retrieved from the table/collection. Otherwise, empty list.
record_ids list of str 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.