O'Reilly logo
  • Jiangtao Fu thinks this is interesting:

Fortunately, the VectorAssembler class can do this work:

From

Cover of Advanced Analytics with Spark, 2nd Edition

Note

VectorAssembler converts each row into sparse vector format.