daft.functions.map_get#
map_get #
map_get(expr: Expression, key: Expression) -> Expression
Retrieves the value for a key in a map column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | the map expression to get from | required |
key | Expression | the key to retrieve | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | the value expression |
Examples:
1 2 3 4 5 6 | |
╭────────────────────┬───────╮
│ map_col ┆ a │
│ --- ┆ --- │
│ Map[String: Int64] ┆ Int64 │
╞════════════════════╪═══════╡
│ {"a": 1} ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ {} ┆ None │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ {"b": 2} ┆ None │
╰────────────────────┴───────╯
(Showing first 3 of 3 rows) Source code in daft/functions/misc.py
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | |