Transform functions manipulate data in various ways like convert types, encode with base 64 and compression.
cast(col, dataType)
Converts a value from one data type to another. The supported types include: bigint, float, string, boolean, bytea and datetime.
When casting to a datetime type, the supported column type and casting rule are:
"2006-01-02T15:04:05.000Z07:00"
.encode(col, encodeType)
Use the encode function to encode the payload, which potentially might be non-JSON data, into its string representation based on the encoding scheme. Currently, only "base64" encoding type is supported.
decode(col, encodeType)
Decode the input string with specified decoding method. Currently, only "base64" encoding type is supported.
compress(input, method)
Compress the input string or binary value with a compression method. Currently, 'zlib', 'gzip', 'flate' and 'zstd' method are supported.
decompress(input, method)
Decompress the input string or binary value with a compression method. Currently, 'zlib', 'gzip', 'flate' and 'zstd' method are supported.
trunc(dec, int)
Truncates the first argument to the number of Decimal places specified by the second argument. If the second argument is less than zero, it is set to zero. If the second argument is greater than 34, it is set to 34. Trailing zeroes are stripped from the result.
chr(col)
Returns the ASCII character that corresponds to the given Int argument.
hex2dec(col)
Returns the decimal value of the given hexadecimal string. The data type of the parameter needs to be string. If the parameter is "0x10"
or "10"
, convert it to 16
.
dec2hex(col)
Returns the hexadecimal string of the given Int type decimal, if the parameter is 16
, convert it to "0x10"
.