Filters the keys and values from an Object data type column based on a specified key value.


Object literal reference example:

derive type:single value:FILTEROBJECT('{"q":"hello","r","there":"q","world"}', 'q') as:'q'

Output: Generates a new q column containing an Object of key-value pairs for the q key:

{"q":["hello", "world"]}


derive type:single value:FILTEROBJECT(obj,'keys')


ArgumentRequired?Data TypeDescription
objYObjectFunction returning an Object or Object literal to be filtered
keysYArrayArray representing the keys to filter. Each element can be a String, function returning a String, or a reference to a column of String values.

obj

Object literal or function returning an Object whose keys you want to extract into an array.

Required?Data TypeExample Value
YesObject literal or functionmyObj

keys

This parameter contains an Array of Strings, each of which represents a key whose values are to be returned with the key as the output of the function.

Required?Data TypeExample Value
YesString or Array['key1','key2','key3']

Example - Parsing query parameters from URLs