实际上,我想使用scala的with column函数从现有Dataframe中的可变列表中添加一个新列,有人能帮忙吗
这就是我想做的,但对我没用
val list1=mutable.MutableList[String]()
val list2=mutable.MutableList[String]()
list1+=convertIntToStringBase(30,account,9) // Applying some transformation to list1
DF.withColumn("New_col",lit(list1)) // Adding the elements of the list as a new column in a dataframe
错误消息:
Exception in thread "main" java.lang.RuntimeException: Unsupported literal type class scala.collection.mutable.MutableList MutableList
提前谢谢!!
1条答案
按热度按时间d7v8vwbk1#
您可以在spark 2.2 typedlit中找到支持seq、map和tuple的代码