Retrieves records from a collection. The operation can optionally return the record IDs which can be used in certain queries such as GPUdb.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 views using this operation. (DEPRECATED)
Parameters
Name of the collection or table from which records are to be retrieved, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing collection or table.
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.
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 max_get_records_size parameter in the server configuration. Use input parameter offset and input parameter limit to request subsequent pages of results. The default value is -9999.
Specifies the encoding for returned records; either binary or json. Allowed values are:
binary
json
The default value is ‘binary’.
Allowed keys are:
return_record_ids – If true then return the internal record ID along with each returned record. Allowed values are:
true
false
The default value is ‘false’.
expression – Filter expression to apply to the table. The default value is ‘’.
The default value is an empty dict ( ).
If True, then OrderedDict objects will be returned, where string sub-type columns will have their values converted back to strings; for example, the Python datetime structs, used for datetime type columns would have their values returned as strings. If False, then Record 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 OrderedDicts, incur a speed penalty, and it is strongly recommended to use the Record object option instead. If True, but none of the returned columns require a conversion, then the original Record objects will be returned. Default value is True.
Returns
A dict with the following entries–
Value of input parameter table_name.
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).
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.
Additional information. Allowed keys are:
total_number_of_records – Total number of records.
has_more_records – Too many records. Returned a partial set. Allowed values are:
true
false
The default value is an empty dict ( ).
Record) –A list of Record objects which contain the decoded records.