我有一个表格,其中包含列 A(int)
和 B(string)
:
A B
1 a,b,c
2 d,e
3 f,g,h
我想创建以下输出:
A B
1 a
1 b
1 c
2 d
2 e
3 f
3 g
3 h
如果有帮助的话,我是在亚马逊 Athena 中进行此操作的(它基于 Presto)。我知道 Presto 提供了将字符串拆分为数组的函数。来自 Presto docs 的内容如下:
不过我不确定接下来该怎么做。split(string, delimiter) → array
将字符串按分隔符拆分并返回一个数组。