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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -