Object Functions
NOTE
Verification Status: Tested and Verified against rekuiper engine with live telemetry stream load on 2026-10-14 20:50:00 UTC.
Scorecard: 12 Verified, 0 Unsupported, 0 Broken:
- Verified (12):
keys,values,object,zip,items,object_construct,object_concat,erase,object_erase,object_pick,obj_to_kvpair_array,object_to_kvpair_array.
Object functions construct, manipulate, and extract data from JSON objects and map structures.
KEYS
keys(obj)Returns an array that contains all keys of the object.
Example:
keys({"a":1, "b":2})Result:
["a","b"]VALUES
values(obj)Returns an array that contains all values of the object.
Example:
values({"a":1, "b":2})Result:
[1,2]OBJECT
object(keys, values)Constructs an object from an array of string keys and an array of corresponding values. Both arrays must have the same length.
Example:
object(["a","b"],[1,2])Result:
{"a":1, "b":2}ZIP
zip(entries)Constructs an object from an array of two-element entry arrays. In each entry array, the first element is a string key and the second element is the value.
Example:
zip([["a",1],["b",2]])Result:
{"a":1, "b":2}ITEMS
items(obj)Returns an array of key-value pairs from the object. Each item in the returned array is a two-element array where the first element is the key and the second element is the value.
Example:
items({"a":1, "b":2})Result:
[["a",1],["b",2]]OBJECT_CONSTRUCT
object_construct(key1, col1, key2, col2, ...)Returns an object constructed from key-value argument pairs. The function requires an even number of arguments. Keys must be strings. If a value is null, the function omits that key-value pair from the output object.
Example:
object_construct("a", 1, "b", 2)Result:
{"a":1, "b":2}OBJECT_CONCAT
object_concat(obj1, obj2, ...)Merges multiple input objects into a single new object. The function requires at least two input objects. When duplicate keys exist across objects, the value from the last object in the argument list overwrites earlier values.
Example:
object_concat({"a": 1}, {"b": 2}, {"b": 3})Result:
{"a":1, "b":3}ERASE
erase(obj, k)
object_erase(obj, k)Removes specified keys from an object. If k is a string, the function removes that single key. If k is an array of strings, the function removes all matching keys. object_erase is an exact synonym.
Example:
erase({"baz": [1, 2, 3], "bar": 'hello world',"foo":'val'}, 'foo')Result:
{"baz": [1, 2, 3], "bar": 'hello world'}OBJECT_PICK
object_pick(obj, k)Extracts only the specified keys from an object. If k is a string, the function retains only that key. If k is an array of strings, the function retains all matching keys.
Example:
object_pick({"baz": [1, 2, 3], "bar": 'hello world',"foo":'val'}, 'foo')Result:
{"foo":'val'}OBJ_TO_KVPAIR_ARRAY
obj_to_kvpair_array(obj)
object_to_kvpair_array(obj)Converts an object into an array of key-value objects. object_to_kvpair_array is an exact synonym.
Example:
obj_to_kvpair_array({"key1":1, "key2":2})Result:
[{"key":"key1", "value":1},{"key":"key2", "value":2}]OBJECT_ERASE
object_erase(obj, key)Drop-in alias for erase. Removes one or more specified keys from a JSON object.
Parameters
obj: The target JSON object/map. Must evaluate to an object.key: A string key name or an array of string key names to remove fromobj.
Return Value
A new JSON object with the specified key(s) removed. If obj is null, returns null. If the key does not exist in obj, returns the original object unaltered without throwing an error.
Example
SELECT object_erase(dev, 'status') AS cleaned_dev FROM demo;Given an input record:
{
"dev": {
"id": "d1",
"temp": 25.4,
"status": "active"
}
}Result:
{
"cleaned_dev": {
"id": "d1",
"temp": 25.4
}
}OBJECT_TO_KVPAIR_ARRAY
object_to_kvpair_array(obj)Drop-in alias for obj_to_kvpair_array. Converts a JSON object or map into an array of key-value pair objects.
Parameters
obj: The target JSON object or map to convert.
Return Value
An array of objects where each element contains two fields:
"key": The key name as a string."value": The corresponding value.
Returns null if the argument is null.
Example
SELECT object_to_kvpair_array(metrics) AS kv_list FROM demo;Given an input record:
{
"metrics": {
"cpu": 12.5,
"memory": 64.0
}
}Result:
{
"kv_list": [
{"key": "cpu", "value": 12.5},
{"key": "memory", "value": 64.0}
]
}