Skip to content
Search
DSL · Core

array_unpack

Definition

/**
 * Unpacks each element of an array into a new entry, using the array key as the entry name.
 *
 * Before:
 * +--+-------------------+
 * |id|              array|
 * +--+-------------------+
 * | 1|{"a":1,"b":2,"c":3}|
 * | 2|{"d":4,"e":5,"f":6}|
 * +--+-------------------+
 *
 * After:
 * +--+-----+-----+-----+-----+-----+
 * |id|arr.b|arr.c|arr.d|arr.e|arr.f|
 * +--+-----+-----+-----+-----+-----+
 * | 1|    2|    3|     |     |     |
 * | 2|     |     |    4|    5|    6|
 * +--+-----+-----+-----+-----+-----+
 *
 * @param array<array-key, mixed>|ScalarFunction $array
 */
array_unpack(ScalarFunction|array $array, Schema $schema) : ArrayUnpack

Contributors

Built in the open.

Join us on GitHub
scroll back to top