Overview
Kinetica provides a direct JSON egress service to allow records to be retrieved as raw JSON from the database.
Several options can be used to identify & filter the data being requested. There is also limited support for aggregation.
JSON objects will be returned as an array:
|
|
For examples, see Examples or JSON Egress Snippets.
Usage
The base JSON egress endpoint URL is:
http://<db.host>:9191/get/records/json
Authentication credentials should be passed with the request.
Endpoint-specific options can be passed as request parameters, as well.
Parameters
Name | Default | Description |
---|---|---|
table_name | Name of the table from which to request records, in [schema_name.]table_name format. | |
column_names | * | Names of the columns to extract from table_name. |
offset | 0 | Positive integer indicating the number of initial results to skip (this can be useful for paging through the results). |
limit | -9999 | Positive integer indicating the maximum number of results to be returned, or -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 response parameter has_more_records to see if more records exist in the result to be fetched, and request parameters offset & limit to request subsequent pages of results. |
expression | Filter expression to apply to the table data. In the case of requests with aggregation in them, this filter will be applied before the aggregation occurs. | |
order_by | Comma-separated list of the columns to sort by as well as the sort order; e.g., timestamp asc, x desc. Note This only applies to scalar requests. Requests with aggregation will be sorted on the first aggregation value, in ascending order. | |
having | Filter expression to apply to the aggregated table data. Note This only applies to requests with aggregation in them. |
Examples
Below are templates of requesting table data as JSON, via the /get/records/json REST endpoint:
|
|
|
|
Endpoint-specific options can be passed as URL-encoded data parameters instead of being appended to the URL:
|
|
|
|
Requests containing aggregation functions are also supported:
|
|
|
|
Responses
The endpoint calls will respond with one of two message formats, one for successes and one for failures:
|
|
|
|
An example of each of these is as follows:
|
|
|
|