get_dataset_data¶
- DatasetsApi.get_dataset_data(id, role_id, limit=None, offset=None, action=None, filter_condition=None, sort_field=None, sort_order=None, sort_by=None, sort_order2=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get dataset data
Returns paginated row-level data for an internal dataset. The caller must have at least read-only access. Only datasets with DatasetType “internal” are supported (external/view returns IPV-1041). Normal mode (no action param): Executes SQL queries against Athena (s3athena/lf targets) or Redshift. Supports filtering via filter_condition (Lucene-like syntax) and sorting via sortField / sortOrder. Spatial mode (action=get_spatial_data): Fetches spatially converted data for datasets with DataCategory “spatial”. Returns a different response shape with spatial_columns, spatial_crs, and string-based next_available. Pagination: Use limit and offset. Default limit is 1000 (max 1000). Check nextStart.nextAvailable (boolean) to determine if more pages exist; use nextStart.nextOffset as the next offset value.
- Parameters:
id (str) – Unique identifier (DatasetId) of the dataset. (required)
role_id (str) – IAM role identifier for the calling user. (required)
limit (int) – Maximum number of rows to return per page. Must be a positive integer. Capped at 1000. Defaults to 1000.
offset (int) – Zero-based row offset for pagination. Must be a non-negative integer. Defaults to 0.
action (str) – Set to “get_spatial_data” to fetch spatially converted data. Only valid for datasets with DataCategory “spatial”.
filter_condition (str) – Lucene-like filter expression for the normal (non-spatial) branch. Supports field:”value” matching, range expressions field:”[min TO max]”, wildcards field:”F*”, and boolean operators AND, OR, NOT. Field names must match DatasetSchema column names.
sort_field (str) – Column name to sort by in normal (non-spatial) mode. Must be a valid column in the dataset schema. Ignored if not a valid column.
sort_order (str) – Sort direction for sortField in normal mode. Defaults to ASC.
sort_by (str) – Column name to sort by in spatial mode (action=get_spatial_data only).
sort_order2 (str) – Sort direction for sort_by in spatial mode. Defaults to ASC.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /datasets/{id}/data
Success (HTTP 200)¶
Dataset data retrieved successfully.
Errors¶
Documented error codes: AUTH-1011, IPV-1041, IPV-1012, DS-1040.
HTTP 400
Validation error — dataset not found, user not authorized, invalid DatasetType, or bad filter/sort/limit/offset values.
User has no access to the dataset
{
"Message": "AUTH-1011 - User user@example.com is not authorized to view resource details"
}
Dataset is not internal type
{
"Message": "IPV-1041 - Invalid parameter - DatasetType, allowed values/keys are internal"
}
Non-integer limit value
{
"Message": "IPV-1012 - Invalid parameter - 'limit', this field value must be an integer value."
}
TargetLocation not supported
{
"Message": "DS-1040 - Data fetch feature is only for datasets with TargetLocation - s3athena, redshift, lf"
}
HTTP 500
Internal server error or query timeout