我执行以下操作:
val tempDict = sqlContext.sql("select words.pName_token,collect_set(words.pID) as docids
from words
group by words.pName_token").toDF()
val wordDocs = tempDict.filter(newDict("pName_token")===word)
val listDocs = wordDocs.map(t => t(1)).collect()
listDocs: Array
[Any] = Array(WrappedArray(123, 234, 205876618, 456))
我的问题是如何遍历这个包装数组或将其转换为列表?
对于
listDocs
,我得到的选项是apply
,asInstanceOf
,clone
,isInstanceOf
,length
,toString
和update
。我该怎么做?