我想从一个字符串数组列表中创建一个列列表,如何在java/spark中实现?我试着:
ArrayList<Column> cols = new ArrayList<Column>(listOfStrings);
但是不行,谢谢
gzszwxb41#
你可以用它。
import org.apache.spark.sql.*; List<Column> collect = Arrays.stream(listOfStrings) .map(functions::col).collect(Collectors.toList());
更新:
List<Column> arrayList = listOfStrings.stream() .map(functions::col).collect(Collectors.toList());
1条答案
按热度按时间gzszwxb41#
你可以用它。
更新: