Note
This documentation is for a prior release of Kinetica. For the latest documentation, click here.
URL: http://<db.host>:<db.port>/insert/records/json
Overview
Kinetica provides a direct JSON ingest service to allow raw JSON to be translated into records and inserted into the database.
If the target table exists, inserted records will be appended to it.
If the target table does not exist, it will be created automatically, with type inferencing used to determine column types & sizes, before inserting data.
Tip
To ensure a particular column ordering with a created target table, use the columns_to_load parameter, specifying all columns in the desired order.
Either a single JSON object or multiple JSON objects (as an array) can be ingested at once:
|
|
|
|
For examples, see Examples or JSON Ingest Snippets.
Usage
The base JSON ingest endpoint URL is:
http://<db.host>:9191/insert/records/json
The JSON payload should be passed as data in the request.
Authentication credentials should be passed with the request, as well.
Endpoint-specific options can be passed as request parameters. See /insert/records/frompayload under the option parameter for a complete list of supported options.
Note
Both columns_to_load & columns_to_skip can only be used with named columns, not column positions, as JSON maps don't lend themselves to positional references.
Examples
Below are templates of ingesting a JSON file of product data into a table, via the /insert/records/json REST endpoint:
|
|
|
|
Endpoint-specific options can be passed as request parameters:
|
|
|
|
Data can also be in-lined with the command:
|
|
|
|
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:
|
|
|
|