Skip to main content
Loading in differs in subtle ways that depend on the data format of the source. Loading runs with a strict interpretation of streaming source with or source data to allow pipelines to achieve maximum performance. For text-based formats like JSON and DELIMITED, the Ocient System performs no preemptive casting on the data when using a source field selector. For the Kafka streaming source, use the Schema Registry with subjects that contain a group of schema versions, which capture the schema changes over time. For example, with the JSON string { "my_field": 1234 }, the selector $my_field returns the string "1234" not the integer 1234. When you use transformation functions, keep in mind that the Ocient System treats all data in the JSON and DELIMITED formats as text data. While the Ocient System sends data you select to a final target column, the system automatically casts the data in the final step to ensure that the data is compatible with the target column type. See Data Types for Data Pipelines for supported automatic conversion rules. Format-specific differences also appear in the pipelines.

Load ASN.1 Data

You can load data in ASN.1 (Abstract Syntax Notation One) format from binary-encoded ASN.1 files using DER-encoded or BER-encoded files. ASN.1 provides a flexible, schema-driven format commonly used in telecommunications, security, and standardized protocols. This format allows you to extract structured records and map them to relational tables using SQL. The Ocient System requires .ber and .der files to contain one or more concatenated DER-encoded or BER-encoded values with the specified record type. The system decodes each record independently and maps it into a record.

ASN.1 Type Mapping

The system automatically converts all decoded ASN.1 fields to their JSON-equivalent representations.
The ASN.1 schema must consistently use implicit or explicit tagging. You must specify clear tagging so the system can resolve field names during extraction.
To access fields, use dot notation for access: $sequence.fieldName. For arrays (such as SEQUENCE OF), use bracket notation: $sequenceOf[].fieldElement. Default values and optional fields follow standard ASN.1 rules. If you omit a field, the system evaluates it as NULL.

ASN.1 Loading Example

Assume you have the personnel_records.asn file in the ASN.1 data format. The file contains the definition of a personnel record Example.PersonnelRecord. The ASN.1 file contains data for the personnel record, child, personnel name, employee number of the personnel, and the date.
Text
Create a table to contain the personnel record. The table contains a subset of the data:
  • first_name — First name
  • initial — Initial of the middle name
  • family_name — Last name
  • title — Job title
  • number — Employee number
  • date_of_hire — Hire date
SQL
Create the data pipeline personnel_pipeline to load the personnel record into the personnel_records table using an S3 bucket. Specify the bucket, endpoint, access key identifier, secret access key, and filter options to find the ASN.1 DER-encoded file personnel_records.der in the specified file path. Use the URL file path http://cos/filepath/asn1/personnel_records.asn and record type Example.PersonnelRecord. Access the name sequence using dot notation for the first name, middle initial, and last name fields. The pipeline definition transforms the hire date to the 'yyyyMMdd' format.
SQL

Load Avro Data

The Ocient System enables you to load data in the format. You can use a streaming source with a file-based source only. Load an inline schema definition or use a schema configuration. Use a schema inference from files with embedded schemas. Field selectors in Avro follow the same format as selectors in JSON and formats.
The Ocient System treats Avro selectors as lowercase. To use case-sensitive selectors, you must enclose the selector in double quotation marks. For example, $"testSelector".

Inline Schema

Specify a JSON string in the Avro schema format in the INLINE option of the schema definition of the CREATE PIPELINE SQL statement. Inline schemas assume that all records follow the defined schema exactly. These schemas do not support schema evolution. For Kafka messages, use the SCHEMA_REGISTRY_ID_LOCATION option to denote whether there is an embedded schema identifier. For inline schemas, the 'none' value indicates that no embedded schema identifier is present.

Schema Inference from a File

The system can infer the schema from a file that has embedded schemas. The file is a named object container file. Use the INFER_FROM option in the CREATE PIPELINE SQL statement to specify sampling one file.

Schema Registry

For loading from a Kafka streaming source, use the schema configuration with the SUBJECT option in the CREATE PIPELINE SQL statement to specify the name of the subject for the data pipeline. The default value is <topic name>-value, where <topic name> is the name of the Kafka topic. The Ocient System follows the schema registry configuration from the Confluent platform.

Schema Evolution

When you create a data pipeline, the pipeline has a fixed target schema (specified by the SELECT clause). Individual files might have different schemas. The target schema must be backward-transitive compatible with the other schemas. Individual files or Kafka messages might have different schemas. If the other schemas change, the system automatically attempts to fit data into the target schema. In this case, the other schemas must be forward compatible with the target schema. The system ignores changes to any unused fields from the target schema. To manually change the schema, you must first stop the execution of the data pipeline by using the STOP PIPELINE SQL statement. Then, use the ALTER PIPELINE SQL statement to modify the schema. You can add a field, remove a field, or change the precision of a data type. For details, see the ALTER PIPELINE SQL statement.
Multiple schemas impact the performance of the data pipeline execution. For best performance, use a single schema for all data.

Avro Type Mapping

The Ocient System converts these Avro data types to Ocient SQL types. This table shows the respective conversions.

Avro Loading Examples

Create the users table with these columns:
  • id — Universally Unique IDentifier (UUID) of the user
  • firstname — First name of the user
  • lastname — Last name of the user
  • birthyear — Year of birth
  • groups — List of groups where the user belongs
SQL
These examples use this table as the target table for the load. Load Avro Data from Files Assume you have user data in Avro format in multiple files in the /data/users directory. Create the users_pipeline data pipeline for the Avro files *.avro containing user data. The schema configuration instructs the system to infer from one file using the INFER_FROM option. Access the array of strings for the groups column.
SQL
Load Avro Data from an Inline Schema Definition Assume you have user data in Avro format in multiple files in the /data/users directory. Create the users_pipeline data pipeline for the Avro files *.avro containing user data. The schema configuration instructs the system to use an inline schema definition with the INLINE option. Access the array of strings for the groups column.
SQL
Load Avro Data Using a Kafka Schema Registry Configuration Assume you have user data in Avro format in a Kafka topic. Create the users_pipeline data pipeline for the user data. The schema registry configuration instructs the system to access the subject 'users-value' at the registry location 'value' using the registry URL 'https://schema-registry.company.com'. The configuration specifies the access credentials using the CONFIG option:
  • Credentials source
  • User authentication that includes the username and password
  • Location of the truststore
  • Password for the truststore
Access the array of strings for the groups column.
SQL
For details about the schema registry configuration, see the Confluent Documentation.

Load Binary Data

The Ocient System loads the binary data format using a fixed record length to split a binary stream into chunks that represent records. Each record is available in the SELECT portion of a pipeline definition using a special binary extract syntax $"[5,8]". This operates similarly to a substring function, beginning at byte 5 and taking 8 bytes from that location. The starting index is a 1-based offset, consistent with other SQL arrays and offsets. You can use this syntax to select specific bytes within a record to parse together as a unit.

Binary Selector

Example The Binary Selector takes 8 bytes starting at offset 11 on the fixed-width binary record. Consistent with SQL functions in the Ocient System, the first argument value 11 is the 1-based offset into the byte array.
The Binary Selector returns BINARY data, not VARCHAR. Special BINARY transformation functions can operate on this BINARY data. However, if you cast data to the VARCHAR type by using CHAR(), then functions like INT operate on this data as VARCHAR data, not binary data. When you load binary data into VARCHAR columns, the Ocient System automatically converts from binary to character data using the configured CHARSET_NAME before final loading. The Ocient System supports special transformation functions that operate uniquely on binary data. With these functions, you can convert binary representations from mainframe systems such as packed decimals, zoned decimals, big and little endian integers (signed and unsigned), and floating point values. For more details, see Binary Data Transformation Functions. For a complete list of supported options for DELIMITED and CSV data formats, see Binary Extract Options.

Binary Loading Example

If each record in your fixed-width binary schema includes these fields, you can use the SUBSTRING function and the transforms shown in this example. Each record includes 62 bytes, so the record length RECORD_LENGTH is 62. The encoding of this file is CP500 instead of the default IBM1047 code page. The CREATE PIPELINE SQL statement specifies this encoding.
SQL
This SQL statement:
  • Uses the BINARY SELECTOR to extract names and load them into the respective columns. The Ocient System automatically decodes the values using cp500 and loads them into a VARCHAR column. An explicit cast such as CHAR($"[1, 20]") as first_name works equivalently.
  • Indicates the extraction of four bytes that represent age from bytes 41-44. The statement instructs the casting of these bytes as an integer INT. This function uses the default endianness (big) and treats the bytes as signed. Unsigned values can overflow target columns because integral types are all signed.
  • Extracts the 10 bytes for total_spent using the BINARY SELECTOR, and converts the values using the packed decimal option for the DECIMAL cast. The casting requires specifying the number of decimal points in the source data. In this case, there are 2 decimal points, which match the number in the target column.
  • Extracts the 8 bytes that represent user_id using the BINARY SELECTOR and casts these bytes to a BIGINT while interpreting the bytes as unsigned with the little endian representation.

Load Delimited and CSV Data

When you load data from delimited or CSV files, the Ocient System tokenizes the data during loading. The system detects records and fields in the input data during pipeline execution. You can reference fields and use them in combination with transformation functions before the system stores values in the column of a target table. Files must be located in these allowed directories:
  • /tmp directory
  • The temporary directory you configure using the streamloader.extractorEngineParameters.tempDir configuration option (default path is /var/opt/ocient/tmp).
  • The directory list specified by the streamloader.extractorEngineParameters.configurationOption.filesystem.access.directories configuration option (default is an empty list).
Files cannot be located in these blocked directories:
  • /etc
  • /bin
  • /sbin
  • /lib
  • /lib64
  • /usr
  • /boot
  • /proc
  • /sys
  • /run
  • /root
  • /var/lib
  • /var/log
  • /var/run
  • /var/cache
Referencing fields of the source data for the formats happens by using a field index. The index is a number that follows the dollar sign $. To maintain consistency with SQL array semantics, the field indexes start at 1. Reference the first field of tokenized source records for the DELIMITED and CSV formats as $1.
For the BINARY format, $0 represents the entire record. In this case, you must specify $0 in combination with the SUBSTRING function to extract specific bytes from the source data.
For a complete list of supported options for DELIMITED and CSV data formats, see Delimited and CSV Extract Options.

Delimited Loading Example

Use this example delimited data.
Text
For this example row, this table shows the field references for each value in the row. To load this data in a pipeline with the DELIMITED data format, this CREATE PIPELINE statement specifies the | character for the field delimiter. This statement loads data into AWS S3. The SELECT statement uses fields 1, 2, 3, 5, and 6 of the source data. The statement specifies that the system should not load field 4 to the target table. Field 6 is an array of data matching the default array settings for delimited data. You can indicate this with the array brackets like $6[] to load into a CHAR[] typed column. The outer casting functions in this example are optional and shown for completeness. If they are omitted, the pipeline automatically casts the source fields to the target column type.
SQL

Load JSON Data

The data pipeline syntax enables the load of JSON data, including nested scalars, arrays, and points ST_POINT.
Strict Loading and TransformationsWhen you use transformation functions, remember that the Ocient System treats all data in JSON and DELIMITED format as text data, not the logical data type.For example, if you specify the JSON string { "my_timestamp": 1709208000000 }, the selector $my_timestamp returns the string "1709208000000" and not the integer 1709208000000.As a result, if you cast this data into a timestamp column, such as TIMESTAMP($my_timestamp) as created_at, the Ocient System returns an error. The conversion fails because the cast function assumes you are specifying TIMESTAMP(VARCHAR), which assumes a format like YYYY-MM-DD HH🇲🇲ss[.SSSSSSSSS].To correct this issue, cast the value explicitly to make use of the TIMESTAMP(BIGINT) function that treats the argument as milliseconds after the epoch as in TIMESTAMP(BIGINT($my_timestamp)) as created_at.

Supported JSON Selectors

JSON selectors consist of $ followed by a dot-separated list of JSON keys. If a key refers to an array, it is followed by a set of brackets [] to correspond to its dimensionality. If the square brackets contain an index, like [1], then the selector refers to an array element.
The Ocient System treats JSON selectors as lowercase. To use case-sensitive selectors, you must enclose the selector in double quotation marks. For example, $"testSelector". With case-sensitive selectors having multiple JSON keys, each key needs double quotation marks. For example, $"testData"."Responses"."SuccessResponse".
For special characters (any identifier that starts with any character other than a letter or contains any character that is not a letter, number, or an underscore) or reserved SQL keywords (such as SELECT), you must enclose such selectors in double quotation marks. For example, if you have a JSON document { "test-field": 123 }, then the selector for the query should be $"test-field". The Ocient System does not support identifiers with a backslash as the last character in the key name. This table shows the selector and provides its description. The cells in the last column of the table show an example for each selector. First, the cell shows example data in JSON format. Then, the cell shows the use of the selector and its output after the arrow. For more examples of using JSON selectors in data pipelines, see JSON Selectors Examples in Data Pipelines.

NULL and Empty Handling for JSON Scalars

The Ocient System handles all JSON NULL, empty, and missing values in the same way. The system loads these values as NULL. These values fail to load into non-nullable columns. Provide an explicit default in the pipeline using IF_NULL or COALESCE or use the COLUMN_DEFAULT_IF_NULL option to accept the configured column default instead of attempting to load NULL values.

NULL and Empty Handling for JSON Arrays

The Ocient System handles NULL, empty, and missing values the same way for arrays as for scalars. The system converts a value that is NULL, empty, or missing to NULL and loads it as NULL. Provide an explicit default in the pipeline or use the COLUMN_DEFAULT_IF_NULL option to accept the configured column default instead of attempting to load NULL.

NULL and Empty Handling for JSON Tuples

All the rules for handling NULL, empty, and missing elements that apply to scalars and arrays also apply to tuples. If any part of the selector is NULL, empty, or missing, data pipeline loading converts that value to NULL. Additionally, because you can apply functions to tuple elements (and not array elements), you can use the NULL_IF function to convert a tuple element to NULL. For example, tuple<<char,varchar>>($a.name, NULL_IF($a.hometown, 'N/A') ) indicates to the pipeline that the string 'N/A' signifies NULL for the hometown element but not for the name element.

Load Parquet Data

The data pipeline functionality enables loading Parquet files with this configuration. File Configuration
  • Files should have row groups of less than 128 MB. Larger row groups can impact memory usage during loading, and row groups of 512 MB can cause loading failures on 1 TB or more data sets.
  • Encoding fields in a Parquet file reduces the space of the file on disk but can impact memory usage during loading. Enable encoding on fields that you expect to have less than 256 unique values and for fields that contain short strings. You do not have to encode other fields.
Multiple Files
  • You can load row groups of multiple Parquet files in parallel. For large data sets, load the data set as multiple files.
  • Loading files with differing schemas is not supported.
Use selectors as you do when loading JSON data to specify data to load.
You must select a leaf element, an array, or a tuple with your selector. This is stricter than using JSON selectors, which can directly select array fields and JSON object fields.Example: {"a": [1,2,3], "b": {"c": 1}}You can extract with any of the selectors in JSON: $a, $a[], $b, $b.cHowever, Parquet only allows for the selectors: $a[], $b.cThis example assumes this schema:
The selector must be $my_list[], which includes the array syntax.
For details, see Parquet Selectors Examples in Data Pipelines.
When you use the FORMAT PARQUET option with an AWS S3 source, the ENDPOINT option is required in the CREATE PIPELINE SQL statement.
Auto-casting in Parquet does not support the automatic conversion to VARCHAR columns. You must explicitly cast data to the CHAR data type when you convert Parquet data that is not string data to a VARCHAR column or VARCHAR function argument.
The Ocient System treats Parquet selectors as lowercase. To use case-sensitive selectors, you must enclose the selector in double quotation marks. For example, $"testSelector".

Schema Evolution

The Ocient System supports schema evolution when you load a set of Parquet files. Specifically, if the pipeline selects a set of Parquet files where an individual file might have more or fewer columns than another, the system attempts to merge those schemas together to support loading without requiring you to create the pipeline again. For example, the test_table table has three columns.
SQL
You have two Parquet files with these schemas:
Text
However, you must specify how to handle the schema evolution within the EXTRACT SQL statement. You can choose to sample the first file only for its schema or sample the entire data set to merge the schemas together. This DDL statement samples on one file.
SQL
The disadvantage is that sampling multiple files can potentially take a long time (scaling with the number of files in the data set) when you execute the CREATE PIPELINE and START PIPELINE SQL statements. If you know that all of the Parquet files have the same schema, use this syntax. The Ocient System does not support the case where a column within the schema changes type. For example, if col_a is an INT type in one file and a VARCHAR type in another. The default behavior of schema evolution infers the schema from one file. Use this syntax to infer from one file.
SQL

Parquet Type Mapping

Parquet data types are separated into primitive and logical types. The Ocient System converts these types to Ocient SQL types. See these tables for the respective conversions.
  • The INTERVAL data type is not supported.
  • The UINT64 data type can overflow the BIGINT conversion.
  • The DURATION data type conversion to BIGINT preserves the underlying units. For example, the number of microseconds stays as microseconds in the BIGINT data type.
Further, Parquet contains nested types that the Ocient System also converts to SQL types, as shown in this table.

Parquet Loading Example

Create a data pipeline that loads Parquet files using an AWS S3 bucket. Specify the bucket, endpoint, access key identifier, secret access key, and filter options to find all Parquet files in the specified file path. Use the parquet_base_table table to store the loaded data. Retrieve the integer, text, floating point, double, integer, JSON, and BSON fields.
SQL

Parquet File-Partitioned Data

With Parquet, you can load file-partitioned data from Parquet files using the file path structure. Use the filter set in the file path using the naming standards. Assume files with these file paths.
Shell
Load the data values in the Parquet file partitions using the METADATA function with the Hive partition syntax and the specified partition key dt from the file paths.
SQL
For details about this syntax, see Load Metadata and File-Based Partitioned Data in Data Pipelines.

Load XML Data

You can load data in XML format into the Ocient System. The system supports XML tags, basic elements, nested elements, and CDATA, but it does not support XML arrays and attributes.

Supported XML Selectors

Like JSON selectors, you can select XML data using the $ symbol followed by a list of dot-separated JSON keys.
The system treats JSON selectors as lowercase. To use case-sensitive selectors, you must enclose the selector in double quotation marks, such as $"testSelector". With case-sensitive selectors having multiple JSON keys, each key needs double quotation marks, such as $"testData"."Responses"."SuccessResponse".
The system does not support JSON array and tuple selectors.

XML Loading Example

Assume an XML file with this data.
XML
Create a table to contain the IP address record:
  • name — Name
  • city — Name of the city
  • zip — Zip code
  • personal_ip — IP address
SQL
Create a data pipeline xml_pipeline that loads the XML file test.xml using an AWS S3 bucket. Specify the bucket, endpoint, access key identifier, secret access key, and filter options to find the XML file in the specified path. Use the example_xml table to store the loaded data. Use JSON selectors to parse the file and data in each XML tag. The system parses the CDATA section in the note tag as the literal string Personal IP <b>127.0.0.1</b>. Use the SUBSTRING function to extract the IP address and then transform it into an IPV4 type with the IPV4 function. For details, see the SUBSTRING and IPV4 functions.
SQL
JSON Selectors Examples in Data Pipelines Data Pipelines Reference Load Metadata and File-Based Partitioned Data in Data Pipelines
Last modified on June 8, 2026