scala - udf spark column names -
i need specify sequence of columns. if pass 2 strings, works fine
val cols = array("predicted1", "predicted2")
but if pass sequence or array, error:
val cols = array(seq("predicted1", "predicted2"))
could please me? many thanks!
function signature def array(colname: string, colnames: string*): column
means takes 1 string , 1 or more strings. if want use sequence, this:
array("predicted1", seq("predicted2"):_*)
from can see in code, there couple of overloaded versions of function, neither 1 takes seq
directly. converting varargs described should way go.
Comments
Post a Comment