[英]Get value from array based on index
Athena 很新,數據結構如下:
指數 | 大批 |
---|---|
[1] | [1,2,3] |
[2] | [2,3,4] |
如果我想根據索引列中的值從每個數組中獲取特定值,如何獲取以下 output? 例如,根據提供的索引,預期的 output 應該是 1 和 3
用於訪問數組元素的 Athena 文檔: https://docs.aws.amazon.com/athena/latest/ug/accessing-array-elements.html
index
是 integer:SELECT element_at(array, index)
FROM your_table
index
是一個數組:SELECT element_at(array, index[1])
FROM your_table
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.