Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Get an item from an array or map column.
Syntax
getItem(key)
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
value | Index for array or key for map |
Returns
Column
Examples
df = spark.createDataFrame([([1, 2], {"key": "value"})], ["l", "d"])
df.select(df.l.getItem(0), df.d.getItem("key")).show()
# +----+------+
# |l[0]|d[key]|
# +----+------+
# | 1| value|
# +----+------+