flatten_leaves¶
Type of operation: Semistructured
Description¶
Given an input of object or array type, recursively flatten all child elements into ‘_c_NAME_path’ and ‘_c_NAME_value’ columns, returning only leaf values. The default is to not suggest column types (‘suggesttypes’ = ‘false’.) See also flatten_single.
Usage¶
flatten_leaves pathexpression [ , suggesttypes ]
Argument |
Type |
Required |
Multiple |
Constant |
---|---|---|---|---|
pathexpression |
fieldref |
Required |
Only one |
Variable |
suggesttypes |
bool |
Optional |
Only one |
Variable |
Accelerable¶
flatten_leaves is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.
Examples¶
flatten_leaves foo
Produce new columns that contain every leaf path and its corresponding value. Column ‘foo’ will be removed.
flatten_leaves foo, true
Produce new columns that contain every leaf path and its corresponding value. It will also attempt to determine the value’s type, creating a third column, ‘_c_foo_type’, containing the name of the identified type. Column ‘foo’ will be removed.
Aliases¶
flattenleaves
(deprecated)