The trick here is getting the scala compiler to do the implicit conversion
from Symbol -> Column. In your second example, the compiler doesn't know
that you are going to try and use the Seq[Symbol] as a Seq[Column] and so
doesn't do the conversion. The following are other ways to provide enough
i
Well:
I think that I solved my issue in the next way:
val variable_fieldsStr = List("field1","field2")
val variable_argument_list= variable_fieldsStr.map(f => Alias(Symbol(f),
f)())
val schm2 = myschemaRDD.select(variable_argument_list:_*)
schm2 seems to have the required fields, but would li
I am trying to pass a variable number of arguments to the select function
of a SchemaRDD I created, as I want to select the fields in run time:
val variable_argument_list = List('field1,'field2')
val schm1 = myschemaRDD.select('field1,'field2) // works
val schm2 = myschemaRDD.select(variable_arg