Transformation functions in LAT are case sensitive. The standard syntax for transformation function calls is all lower case characters.
Standard JMESPath Functions
The following standard JMESPath Functions are supported in LAT Transformation expressions. For details about using these functions, see JMESPath Functions.Other Transformation Functions
The following transformation functions are also available in LAT transformation expressions.add
Returns the sum of the two arguments.
array_cap
Caps the length of an array to a maximum number of elements.
array_cat
Concatenate two arrays, returning an array. Accepts an array or null value, returning an empty array if both parameters are null.
concat
Concatenates two strings or converts arguments into strings and concatenates them into a string.
divide
Returns the floating-point division of the two arguments.
hash_code
Returns an integer hash code for a string, number, or Boolean.
if
Returns one of the other arguments based on the truth value of the first. When the first argument is true, return the second argument. When false, return the third.
A NULL input into the first argument will be evaluated as false. Both branches are eagerly evaluated.
json
Parses a string into a JSON value for use in further JMESPath operations. All values other than string are returned unmodified. Strings containing null, boolean, number, array, and object types are supported.
lazy_if
Returns one of the other arguments based on the truth value of the first. When the first argument is true, return the second argument. When false, return the third. The second and third arguments are both expressions. Branches are lazily evaluated.
left
Returns the num_chars leftmost characters of the string column. If null, null is returned. If the index is greater than the length of the string, the entire string is returned.
lower_case
Returns lower case version of a string.
lpad
Pads an input string to a specified length with a padding string added to the left side.
ltrim
Removes leading contiguous instances of a set of characters in a given string.
map
An override of JmesPath’s built in map which maps a given expression into elements of an array. This override makes the small adjustment that if the array itself is null, then a null is returned.
matches
Returns Boolean for whether this input matches the pattern.
Flags can be:
s→ Pattern.DOTALLm→ Pattern.MULTILINEi→ Pattern.CASE_INSENSITIVEx→ Pattern.COMMENTSq→ Pattern.LITERAL
millis_to_timestamp
Converts an integer number of milliseconds since the Epoch to an Ocient timestamp column.
multiply
Returns the floating-point multiplication of the two arguments.
nanos_to_timestamp
Converts an integer number of nanoseconds since the Epoch to an Ocient timestamp column.
normalize_space
Removes leading and trailing whitespace and replaces connected whitespace with a single space.
now, current_timestamp
Returns the current timestamp in nanos. This will correctly load into an Ocient timestamp column
null_if, nullif
Returns null if the first argument matches any of the following arguments. Can be applied to multiple columns or to compare a column with a constant. Can also be used with more than two arguments in which case returns null if a matches any of the subsequent arguments. Returns the value the first argument if it does not match any other arguments.
parse_array
Given a string, parses it into an array of strings. Handles nested arrays as well.
record_uuid
Returns string that represents a unique identifier for the record in a given pipeline for a given file_group or topic. This return value will be consistent over multiple calls in the pipeline’s transformation configuration for the same source record. Can be used as a surrogate key when loading multiple tables from the same source record in a pipeline to facilitate joins when no unique identifier exists on the source record.
replace
Returns string with text matching the regex pattern replaced by the replacement text.
Flags can be:
s→ Pattern.DOTALLm→ Pattern.MULTILINEi→ Pattern.CASE_INSENSITIVEx→ Pattern.COMMENTSq→ Pattern.LITERAL
right
Returns the num_chars rightmost characters of the string column. If null, null is returned. If the index is greater than the length of the string, the entire string is returned.
rpad
Pads an input string to a specified length with a padding string added to the right side.
rtrim
Removes trailing contiguous instances of a set of characters in a given string.
sample
Returns true or false based on the given sample rate. The sample rate must be a number. Commonly used inside of IF statements. An exception will be thrown if the sample rate is outside of [0.0, 1.0].
st_forcepolygonccw
Forces a polygon to have a counterclockwise rotation of the outer polygon ring and a clockwise rotation of the inner polygon ring. You can use this function to convert polygons extracted from systems that interpret polygon rotation differently.
st_geomfromewkb
Returns a geometry from an Extended Well-Known Binary (EWKB) and Well-Known Binary (WKB) representations of a geometry. You can load the result of this function into POINT, LINESTRING, and POLYGON column types.
st_point
Constructs an POINT from numeric coordinates that represent the longitude and latitude of the point.
substring
Returns the substring beginning at start_index (with indexes beginning at 1) to the end of the string, or to num_chars characters.
substring_after
Returns the string after the first occurrence of the needle.
substring_before
Returns the string before the first occurrence of the needle. Both parameters are literal strings.
subtract
Returns the difference of the two arguments.
to_array_length
Turns any JSON object into an array with N copies of that object.
to_binary
Converts a string to binary data for loading into an Ocient binary or hash column.
If mode is 'hex', data is parsed as a sequence of hexadecimal digits. Note that the sequence of digits must not begin with 0x.
Otherwise, mode must be the name of a character encodings listed here, and data is encoded in that encoding.
to_date
Converts a string to a date for loading into an Ocient date column. Format string follows these formatting rules.
to_time
Converts a string into a time of day for loading into an Ocient time column. Format string follows these formatting rules.
to_timestamp
Converts a string to timestamp for loading into an Ocient timestamp column. Format string follows these formatting rules.
to_tuple
Works on tuples that get tokenized at the first nesting level by a given delimiter. Nested tuples, arrays or objects are considered entirely. For each tokenized tuple element, a transformation function can be specified that is applied to the tuple element. Tokenized elements are always treated as strings, requiring additional transformation when being treated as numbers.
tokenize
Returns array of strings after splitting on the regex pattern.
Flags can be:
s→ Pattern.DOTALLm→ Pattern.MULTILINEi→ Pattern.CASE_INSENSITIVEx→ Pattern.COMMENTSq→ Pattern.LITERAL
translate
Replaces characters according to a map of characters. If the to_chars string is shorter than the from_chars string, the function removes the characters that are not mapped.
trim
Removes leading and trailing contiguous instances of a set of characters in a given string.
truncate
Truncates a decimal number to have a specified number of digits after its decimal point.
If decimal is null, this function returns null.
tuple_element_transformation
Works on an element of a given array and applies the specified expression to that element. The function returns an array or null if specified.
unique
Return all unique values in an array.
upper_case
Returns upper case version of string.
width_bucket
Returns the bucket number of the queried value in a histogram starting at min, ending at max, and consisting of num_buckets count of buckets.
- The values are inclusive on the lower bound and exclusive of the upper bound so that all buckets are the same width.
- Also note that requesting 100 buckets will actually get you 102 possible buckets. Bucket 0 through 101. Where 0 captures all values below the minimum and 101 captures all values at the maximum and beyond.
zip
Zips N one-dimensional arrays into a single two-dimensional array with each inner array containing N elements.
The resulting outer array will have a length equal to the max length of any input array. For input arrays smaller than the max length, null elements will be placed in the inner arrays.
Special Functions
EXPLODE
Performs an explosion on all indicated columns, producing one row per value in the exploded array. This can be applied to multiple columns in the same table. Non-exploded columns are held constant and exploded columns are zipped together in array order. If multiple exploded columns have different array lengths, the record is exploded into N records where N is the max length. Columns with array lengths less than N will havenull values after each of their values are exploded.
You can explode a maximum of 8,192 array elements for each source record.
Usage
EXPLODE(array[any] arr) can be used like any other JMESPath function on a JSON Array type with a few limitations:
EXPLODEcan only be used as the outermost function in a JMESPath expressionEXPLODEonly works on a single dimension. Multidimensional explode is not supported.
Examples
Single-Column EXPLODE Transform Configuration:JSON
JSON
JSON
JSON
JSON
JSON
col1 has a null value because array1 only has 3 values while array0 has 4.

