I would like to create a Row
with multiple arguments without knowing their number. I wrote something like this in Scala:
def customRow(balance: Int,
globalGrade: Int,
indicators: Double*): Row = {
Row(
balance,
globalGrade,
indicators:_*
)
}
On Spark GitHub, the Row
object seems to accept the :_*
notation considering its apply
method:
def apply(values: Any*): Row = new GenericRow(values.toArray)
But at compilation time, this doesn't seem to be allowed:
Error:(212, 19) no ': _*' annotation allowed here
(such annotations are only allowed in arguments to *-parameters)
indicators:_*
What did I miss?