unpivot_array¶
Description¶
Convert an object into an array of “key”-“value” pairs.
Return type¶
generic array
Domain¶
This is a scalar function (calculates a single output value for a single input row.)
Categories¶
Usage¶
unpivot_array(object, keyFieldName, valueFieldName)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
object |
object |
no |
no |
none |
keyFieldName |
string |
no |
no |
none |
valueFieldName |
string |
no |
no |
none |
Examples¶
unpivot_array(object(FIELD.foo), "key", "value")
Converts ‘{“k1”: “v1”, “k2”: “v2”, …}’ to ‘[{“key”: “k1”, “value”: “v1”}, {“key”: “k2”, “value”: “v2”}, …]’
Aliases¶
array_unpivot
(deprecated)