you can use VectorAssembler class to create as array of features, which is particulary useful with pipelines:
val assembler = new VectorAssembler()
.setInputCols(Array("city", "status", "vendor"))
.setOutputCol("features")
https://spark.apache.org/docs/2.2.0/ml-features.html#vectorassembler