说,我有数据框:
a | b
---------------------------+------------
some_string | A
another_string | B
而且我有[1,2,3]这样的整数列表 我想要的-是将列表列添加到我的数据框。
a | b | c
---------------------------+-----------+------------
some_string | A | 1
some_string | A | 2
some_string | A | 3
another_string | B | 1
another_string | B | 2
another_string | B | 3
没有udf,有什么办法吗?
Use
crossJoin
. Please check below code.