---
title: LAT Data Types in Loading
slug: 6-FeRXgluBx9t8QlgT-PD
description: Discover the supported data types in Ocient for efficient loading and storage optimization.
docTags: 
createdAt: Thu Jul 21 2022 17:05:13 GMT+0000 (Coordinated Universal Time)
updatedAt: Fri Apr 10 2026 20:36:09 GMT+0000 (Coordinated Universal Time)
---

:::hint{type="warning"}
Data Pipelines are now the preferred method for loading data into the Ocient® System. For details, see [Load Data](<././Load Data.md>).
:::

After extracting from source files or topics, data can be transformed and mapped to target columns in Ocient tables.

LAT automatically binds many primitive source data types to Ocient column data types and automatically converts some source types to the target column type. Different source data types automatically bind to target columns using different conventions.

For example, a string in JSON such as `'123'` that loads into an `INT` column properly binds to the corresponding integer value `123`. Similarly, an integer like `456` can automatically bind to an `INT` column as `456`, a `FLOAT` column as `456.0`, and a `VARCHAR` column as `'456'`. Finally, a string including Well-Known Text (WKT) representation of a `POINT` automatically binds into an `ST_POINT` column.

## Empty String Handling

When you attempt to load an empty string into a target column with LAT, most data types raise an error and the record does not load into the target table. The exceptions are `varchar`, `decimal`, `binary`, and `array` column types. In those cases, the data warehouse loads these values:

- `varchar`: An empty string
- `decimal`: 0.0 (with the appropriate precision)
- `binary`: An empty binary blob
- `array`: An empty array

:::hint{type="info"}
When you extract data from text-based formats like delimited data, the data warehouse loads empty data as an empty string unless you use the `empty_as_null` setting.
:::

## NULL Handling

If you do not provide a value for a column in the target table, this table explains what value the data warehouse stores in the column. For the purposes of default value handling, these are equivalent:

- Pipeline is missing a column.
- Pipeline includes a column but the value in the JSON or the source data evaluates to `null`.&#x20;
- Pipeline includes a column but the field is missing on the source record (e.g., `a.b` does not exist in a JSON record).

To transform a NULL or missing value into a default in the pipeline, use the transformation functions. For example: `not_null(a.b, 'my_default')`

| **Ocient Column Definition** | **Database Behavior When Column is Missing or Column Value Evaluates to NULL** |
| ---------------------------- | ------------------------------------------------------------------------------ |
| NOT NULL with default        | Default                                                                        |
| NOT NULL with no default     | Record fails                                                                   |
| Nullable with default        | Default                                                                        |
| Nullable with no default     | NULL                                                                           |

## Data Type Binding

Refer to the [Data Types](<././SQL Reference/Data Types.md>) for detailed information about each data type. These tables describe the automatic binding conventions of each data type.

### `BIGINT`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Number and String can be either integer or floating point values and are converted to 64-bit signed integers. Decimals are dropped. '+','-' can be used at the beginning of a string to indicate sign. String overflows result in errors, while numeric overflows are silent.  |
| **Example:**                | \{     &#xA;  "number\_bigint": 1.0,     &#xA;  "string\_bigint": "1" &#xA;} &#xA;-> 1, 1                                                                                                                                                                                      |

### `BINARY`

| **Valid JSON Bind Types:**  | String                                                                                                       |
| --------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Converted as UTF-8 to binary: each character in the string taking its binary representation.                 |
| **Example:**                | \{     &#xA;  "string\_binary": "hello" &#xA;} &#xA;-> BINARY(01101000 01100101 01101100 01101100 01101111)  |

### `BOOLEAN`

| **Valid JSON Bind Types:**  | Boolean, String                                                                                                                                                                            |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | For a value of true, a string must be one of (case insensitive): true, t, yes, on, y, 1. <br />For a value of false, a string must be one of (case insensitive): false, f, no, off, n, 0.  |
| **Example:**                | \{     &#xA;  "boolean": true,     &#xA;  "string\_0": "yes",     &#xA;  "string\_1": "FALSE" &#xA;} &#xA;-> true, true, false                                                             |

### `DATE`

| **Valid JSON Bind Types:**  | String, Number                                                                                                                                                                              |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | If String, must be in format "YYYY-MM-DD". If Number must be an EPOCH\_DAY. Use the built-in TO\_DATE function to convert a string with a different date format to an EPOCH\_DAY and bind.  |
| **Example:**                | \{     &#xA;  "string\_date": "2021-11-04",     &#xA;  "epoch\_date": 0 &#xA;} &#xA;-> DATE(2021-11-04), DATE(1970-01-01)                                                                   |

### `DECIMAL`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Valid Logical Types:**    | Decimal                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Note:**                   | Number and String can be either integer or floating point values. Precision and scale for the loaded data are defined by the database table definition. The target column must support enough digits both before and after the decimal point to accommodate decimal values extracted from Fixed Width Binary or other record formats that support decimal data. If insufficient precision or scale exists in the target column, the data will fail to load.  |
| **Example:**                | \{     &#xA;  "number\_decimal": 1.0,     &#xA;  "string\_decimal": "1.1" &#xA;} &#xA;-> DECIMAL(1.0), DECIMAL(1.1)                                                                                                                                                                                                                                                                                                                                          |

### `DOUBLE`, `DOUBLE PRECISION`

| **Valid JSON Bind Types:**  | Number, String                                                                                 |
| --------------------------- | ---------------------------------------------------------------------------------------------- |
| **Note:**                   | Number and String can be either integer or floating point values.                              |
| **Example:**                | \{     &#xA;  "number\_double": 1.0,     &#xA;  "string\_double": "1" &#xA;} &#xA;-> 1.0, 1.0  |

### `HASH`

| **Valid JSON Bind Types:**  | String                                                                                                             |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Converted as hexadecimal to binary: each character in the string must be a valid hexadecimal digit /\[0-9a-f]+/i.  |
| **Example:**                | \{     &#xA;  "hex\_string": "0a1b" &#xA;} &#xA;-> HASH(0000 1010 0001 1011)                                       |

### `INT`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Number and String can be either integer or floating point values and are converted to 32-bit signed integers. Decimals are dropped. '+','-' can be used at the beginning of a string to indicate sign. String overflows result in errors, while numeric overflows are silent.  |
| **Example:**                | \{     &#xA;  "number\_int": 1.0,     &#xA;  "string\_int": "1" &#xA;} &#xA;-> 1, 1                                                                                                                                                                                            |

### `IPV4`

| **Valid JSON Bind Types:**  | String                                                                        |
| --------------------------- | ----------------------------------------------------------------------------- |
| **Note:**                   | Source data must be in the form: \[0-255].\[0-255].\[0-255].\[0-255]          |
| **Example:**                | \{     &#xA;  "string\_ipv4": "192.168.0.1" &#xA;} &#xA;-> IPV4(192.168.0.1)  |

### `IP`

| **Valid JSON Bind Types:**  | String                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Source string can be in IPV4 or IPV6 format. IPV6 can appear in full form as shown in this example or in condensed form. Condensed form can use :: notation (e.g., 2001\:cdba::3257:9652) and leading zeros in IPV6 hextets can also be omitted (e.g., 2001:0db8:0000:0000:0000:0000:3257:9652 → 2001\:db8:0:0:0:0:3257:9652). IPV6 can also appear as a string of 32 hex characters without colons (e.g., 2001cdba000000000000000032579652).  |
| **Example:**                | \{     &#xA;  "string\_ip\_ipv4": "192.168.0.1",     &#xA;  "string\_ip\_ipv6": "2001\:cdba:0000:0000:0000:0000:3257:9652" &#xA;} &#xA;-> IP(192.168.0.1), IP(2001\:cdba:0000:0000:0000:0000:3257:9652)                                                                                                                                                                                                                                        |

### `LINESTRING`, `ST_LINESTRING`

| **Valid JSON Bind Types:**  | String                                                                                                                                                                    |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Must be in the WKT format "LINESTRING(LONG LAT, … )" or "LINESTRING EMPTY"                                                                                                |
| **Example:**                | \{     &#xA;  "string\_st\_linestring": "LINESTRING(-71.064544 42.28787, -90.444444 89.562993)" &#xA;} &#xA;-> ST\_LINESTRING(-71.064544 42.28787, -90.444444 89.562993)  |

### `MATRIX`

| **Valid JSON Bind Types:**  | Array\[Array], String                                                                                                                                                                                                            |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Arrays must be two-dimensional with the same rows and columns as specified in the table. String must be in JSON two-dimensional array format. Each element will be cast according the the element type’s rules in this section.  |
| **Example:**                | \{     &#xA;  "int\_matrix": \[\[0, 1, 2],\[3, 4, 5],\[6, 7, 8]],  &#xA;  "string\_matrix": "\[\[0,1],\[2,3]]" &#xA;} &#xA;-> MATRIX\[\[0,1,2],\[3,4,5],\[6,7,8]], MATRIX\[\[0,1],\[2,3]]                                        |

### `POINT`, `ST_POINT`

| **Valid JSON Bind Types:**  | String                                                                                                          |
| --------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Must be in the format "POINT(LONG LAT)"                                                                         |
| **Example:**                | \{     &#xA;  "string\_st\_point": "POINT(-71.064544 42.28787)" &#xA;} &#xA;-> ST\_POINT(-71.064544, 42.28787)  |

### `POLYGON`, `ST_POLYGON`

:::hint{type="info"}
Ensure that polygons are oriented in your intended way when you load them as polygon orientation matters in Ocient semantics. If you intend all polygons to be oriented counter-clockwise, use the [st\_forcepolygonccw](<./LAT Data Transformation with JMESPath/LAT Transformation Functions.md>) transform function to enforce counter-clockwise semantics.
:::

| **Valid JSON Bind Types:**  | String                                                                                                                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Must be in the WKT format "POLYGON((LONG LAT, … ))" or "POLYGON((LONG LAT, … ), (LONG LAT, … ))" or "POLYGON EMPTY"                                                                              |
| **Example:**                | \{     &#xA;  "string\_st\_polygon": "POLYGON((-87.62 41.87, -89.40 43.07, -87.906 43.04, -87.62 41.87))" &#xA;} &#xA;-> ST\_POLYGON((-87.62 41.87, -89.40 43.07, -87.906 43.04, -87.62 41.87))  |

### `REAL`, `FLOAT`, `SINGLE PRECISION`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                  |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Number and String can be either integer or floating point values. Precision and scale are inherited from the table definition.  |
| **Example:**                | \{     &#xA;  "number\_float": 1.0,     &#xA;  "string\_float": "1" &#xA;} &#xA;-> 1.0, 1.0                                     |

### `SMALLINT`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | Number and String can be either integer or floating point values and are converted to 16-bit signed integers. Decimals are dropped. '+','-' can be used at the beginning of a string to indicate sign. String overflows result in errors, while numeric overflows are silent.  |
| **Example:**                | \{     &#xA;  "number\_smallint": 1.0,     &#xA;  "string\_smallint": "1" &#xA;} &#xA;-> 1, 1                                                                                                                                                                                  |

### `TIME`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                    |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | String must be in the format: HH\:MM\:SS\[.SSSSSSSSS]. Number must represent nanoseconds since midnight. Use the TO\_TIME transformation function to convert an arbitrary string format to nanoseconds and bind.  |
| **Example:**                | \{     &#xA;  "number\_time": 1000000000,     &#xA;  "string\_time": "07:33:10.0001" &#xA;} &#xA;-> TIME(00:00:01.0000), TIME(07:33:10.0001)                                                                      |

### `TIMESTAMP`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Note:**                   | String must be in the format: YYYY-MM-DD HH\:MM\:SS\[.SSSSSSSSS]. Number must represent nanoseconds since epoch. Use the TO\_TIMESTAMP transformation function to convert an arbitrary string format to nanoseconds and bind.  |
| **Example:**                | \{     &#xA;  "number\_timestamp": 1000000000,     &#xA;  "string\_timestamp": "2021-11-04 07:33:10.0001" &#xA;} &#xA;-> TIMESTAMP(1970-01-01 00:00:01.0000), TIMESTAMP(2021-11-04 07:33:10.0001)                              |

### `TINYINT`, `BYTE`

| **Valid JSON Bind Types:**  | Number, String                                                                                                                                                                                                                                                                |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Number and String can be either integer or floating point values and are converted to 8-bit signed integers. Decimals are dropped. '+','-' can be used at the beginning of a string to indicate sign. String overflows result in errors, while numeric overflows are silent.  |
| **Example:**                | \{     &#xA;  "number\_smallint": 1.0,     &#xA;  "string\_smallint": "1" &#xA;} &#xA;-> 1, 1                                                                                                                                                                                 |

### `TUPLE`

| **Valid JSON Bind Types:**  | Array, String                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | String must be in JSON array format "\[e0,e1,e2]". Each element will be cast to the tuple element type at that element’s index from the Ocient table according to the rules for that element type in this section.                                                                                                                                                                    |
| **Example:**                | \{     &#xA;  "double\_int": \[1.0, 1],     &#xA;  "string\_array": \["Ocient", \[0, 1]],     &#xA;  "string\_tuple": "\[1.0, 1]",     &#xA;  "tuple\_tuple": \[\[1.0, 1],\["Ocient", 2]] &#xA;} &#xA;-> TUPLE(DOUBLE, INT)(1.0, 1), TUPLE(STRING, INT\[])("Ocient", INT\[0, 1]), TUPLE(DOUBLE, INT)(1.0, 1), TUPLE(TUPLE(DOUBLE, INT), TUPLE(VARCHAR, INT)((1.0, 1), ("Ocient", 1))  |

### `TYPE[]`

| **Valid JSON Bind Types:**  | Array, String                                                                                                                                                                                                                                                                                                                                 |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | String must be in JSON array format "\[e0,e1,e2]". Each element will be cast to the array element type from the Ocient table according to the rules for that element type in this section.                                                                                                                                                    |
| **Example:**                | \{     &#xA;  "int\_array": \[0,1,2],     &#xA;  "2d\_array": \[\[0, 1, 2],\[3, 4]],     &#xA;  "string\_array": "\[0,1,2]",     &#xA;  "tuple\_array": \[\[0, 1.0, "Ocient"],\[1, 2.0, "rocks"]] &#xA;} &#xA;-> INT\[0,1,2], INT\[]\[INT\[0,1,2],INT\[3,4]], INT\[0,1,2] TUPLE(INT, FLOAT, VARCHAR)\[(0, 1.0, "Ocient"), (1, 2.0. "rocks")]  |

### `UUID`

| **Valid JSON Bind Types:**  | String                                                                                                                          |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Source data must be a valid hyphen-separated UUID.                                                                              |
| **Example:**                | \{     &#xA;  "string\_uuid": "40e6215d-b5c6-4896-987c-f30f3678f608" &#xA;} &#xA;-> UUID(40e6215d-b5c6-4896-987c-f30f3678f608)  |

### `VARCHAR`, `CHAR`

| **Valid JSON Bind Types:**  | String, Number, Boolean                                                                                                                                  |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Note:**                   | Number and Boolean types are converted to their string representations.                                                                                  |
| **Example:**                | \{     &#xA;  "number\_string": 1000,     &#xA;  "boolean\_string": true,     &#xA;  "string\_string": "string" &#xA;} &#xA;-> "1000", "true", "string"  |

# Load Geospatial Data

Geospatial data can be loaded from a variety of formats into Ocient. The Ocient System requires special considerations when you load geospatial data into Ocient including:

- Coordinate System
- Supported Geospatial Loading Formats
- Geospatial Type Conversion
- POINT Normalization
- POLYGON Normalization

### Coordinate System

Ocient uses Spatial Reference System ID (SRID) 4326 for all internal geospatial data types. SRID 4326 is defined in the [WGS84 Standard](https://csrc.nist.gov/glossary/term/world_geodetic_system_1984). Before you load the source data, all data should have the SRID 4326 data type. The loading operation ignores any source data that contains the coordinate system SRID information.

## Supported Geospatial Loading Formats

### Well-Known Text

The primary data format for loading geospatial data in Ocient is the Well-Known Text (WKT) format. This string format is a portable format that can represent points, lines, and polygons.

String data in WKT format can automatically load into `POINT`, `LINESTRING`, and `POLYGON` Ocient column types. In addition, arrays of strings in WKT format can automatically load into array columns of a suitable geospatial data type. The Ocient System assumes raw strings are in WKT format when the system loads these strings into geospatial column types.

Each `LINESTRING` or `POLYGON` value can be up to a maximum of 512 MB in size. This means a `LINESTRING` or `POLYGON` can contain approximately 32 million point values.&#x20;

- WKT strings are whitespace insensitive, so `POINT(10 20)` is equivalent to `POINT  (10  20)`.
- WKT strings are case insensitive.
- Extended Well-Known Text (EWKT) is not supported. To load EWKT data, load the substring after the EWKT semicolon as the WKT format.

### Well-Known Binary and Extended Well-Known Binary

The other data formats that can load into Ocient are Well-Known Binary (WKB) and Extended Well-Known Binary (EWKB) formats. The Ocient System requires an explicit transformation function for both WKB and EWKB formats when you load data and convert it into the target column type.

You can use the function `st_geomfromewkb` to transform WKB and EWKB data.

In both cases, the Ocient System represents the WKB or EWKB string data as hexadecimal string data. The hexadecimal string can be one of these formats:

- Only hexadecimal digits: `000000000140000000000000004010000000000000`
- Prefixed with `0x`: `0x000000000140000000000000004010000000000000`
- Prefixed with `\x`: `\x000000000140000000000000004010000000000000`

### Geometry Conversion

Ocient provides the automatic conversion of geometries from simpler types to more complex types. The conversion allows the load of a LINESTRING column with a POINT, or a POLYGON column with a POINT or LINESTRING. This capability also allows the load of arrays of POLYGON data from the source arrays of a combination of POINT, LINESTRING, and POLYGON data, which represents a geometry collection.

### POINT Normalization

During loading, Ocient automatically performs normalization of POINT data into a regular format used within Ocient. The Ocient System performs the following operations on POINT data during the load:

- Constrain longitude to \[-180, 180) and latitude to \[-90, 90]; wrap around invalid coordinates using correct geographical handling.
- Snap points near the pole to the pole.
- Set longitude of points on the pole to 0
- Remove signed zeros from coordinates, so -0 becomes 0.

### POLYGON Normalization

Ocient follows a counterclockwise rotation convention to indicate the outer ring of a POLYGON. The inner ring follows a clockwise rotation. If the Ocient System loads a POLYGON with a clockwise outer ring, the system indicates that the POLYGON is outside of the given ring.

:::hint{type="warning"}
In some cases, the POLYGON load can lead to unexpected results when the source data follows a different polygon rotation convention.
:::

To account for this, the LAT provides the `st_forcepolygonccw` function that forces a counterclockwise rotation of the outer polygon ring and a clockwise rotation of the inner polygon ring when applicable.

### Geospatial Transformation Functions

The LAT has a select set of transformation functions to construct geospatial types and manipulate them during the load. You can find the supported geospatial transformation functions in [LAT Transformation Functions](<./LAT Data Transformation with JMESPath/LAT Transformation Functions.md>).

# Related Links

[Ingest Data with Legacy LAT Reference](<./Ingest Data with Legacy LAT Reference.md>)

[Understanding Data Types](<././Query Ocient/Understanding Data Types.md>)

[Geospatial Functions](<././SQL Reference/Geospatial Functions.md>)
