Rockset supports an extended version of the JSON format which allows for Rockset specific types that are not supported by JSON. This format is used for both query parameters and ingestion.

## JSON Format

Rockset supports many different [data types](🔗) but by default values will be parsed as standard JSON, so the value `hello` will be parsed as a string. A numeric type will be parsed as an integer if it falls within the range of the integer data type and does not contain a floating point or exponent. Otherwise, the value will be read as a float.

## Extended Format

There are many types that Rockset supports that are not JSON native such as `u256` along with [Date and Time](🔗) types, [Geography](🔗) types, etc. To support the interpretation of these types, we wrap them in a JSON object containing a special key `__rockset_type` which is the string value (not case sensitive) of the desired type that will be used to parse the value in the `value` key.

For example, the following JSON object will be interpreted as a value of 10 with type `u256`:



Like `value` there are a few special keys outside of `__rockset_type`**but only `__rockset_type`** will be used to check for the presence of a special typed value. Otherwise these object fields will be read in as part of normal JSON objects.

## Special Keys

### `__rockset_type`

Required in order to specify a typed value. Supports all Rockset [data types](🔗) which means in some cases, like integer parsing, it can be used to override the inferred JSON type.

### `value`

Required string that specifies the value which will be parsed as the requested `__rockset_type`.

### `format`

This field is optional and specifies the format to be used when parsing a [Date or Time](🔗) type. If not specified the default ISO-8601 format for that type will be used. You can lean more about date formatting and Rockset [here](🔗).

### `timezone`

This field is optional and specifies the TZ identifier that will be used to parse a timestamp type. By default UTC will be used.

### `encoding`

A required field for the `bytes` data type. Only base64 is currently supported.

## Use Cases

### Large `int` values

Rockset's native `int` type can support integers between `-2^63` and `2^63-1`, inclusive. However, JSON only supports integers up to`2^53`. To workaround this JSON limitation, use the following format to ingest larger values without losing precision.



### Non-Finite`float` values

JSON does not support non-finite floating point values: `NaN`, `Infinity` (positive infinity), or `-Infinity` (negative infinity). To workaround this JSON limitation, use the following format to ingest these values:



### Encoding `bytes`

Rockset supports arbitrary byte strings using the `bytes` type. However, JSON strings must be valid UTF-8. To work around this JSON limitation, encode the byte string in a UTF-8 string. `base64` is the only supported encoding.



### Ingesting `datetime`

[ISO 8601](🔗) _without_ timezone designator.



### Ingesting `date`

[ISO 8601](🔗) _without_ timezone designator.



### Ingesting `time`

[ISO 8601](🔗) _without_ timezone designator.



### Ingesting `timestamp`

_Either_ [ISO 8601](🔗) _with_ timezone designator, _or_ (if numeric, or a string that can be parsed as numeric) number of _microseconds_ since epoch.



_or_



_or_



### Ingesting `geography`

[Geographies](🔗) represent shapes on the Earth’s surface. Their JSON encoding is [GeoJSON](🔗). Rockset supports points, linestrings, polygons, and multipolygons. Multipolygons are parsed as lists of polygons.