daft.functions.map_keys#
map_keys #
map_keys(expr: Expression) -> Expression
Returns a list of all keys in the map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | the map expression to get from | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | the keys list expression |
Examples:
1 2 3 4 5 6 | |
╭────────────────────┬──────────────╮
│ map_col ┆ keys │
│ --- ┆ --- │
│ Map[String: Int64] ┆ List[String] │
╞════════════════════╪══════════════╡
│ {"a": 1, "b": 2} ┆ [a, b] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ {"c": 3} ┆ [c] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ {} ┆ None │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ None ┆ None │
╰────────────────────┴──────────────╯
(Showing first 4 of 4 rows) Source code in daft/functions/misc.py
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | |