1

Similar to this question (which was solved using drop()) I have the same problem for the spark.sql.row. I checked the documentation, but wasn't able to figure it out on my own. I want to avoid a workaround like toSeq() if there's a cleaner alternative.

How do I retrieve all elements but a one given by index?

import org.apache.spark.sql._
val row = Row(1, 1.2, 57.12, null)
val colIndexToBeExluded = 1
// how do I get all (3) columns but colIndexToBeExluded ?

Thanks!

Community
  • 1
  • 1
Boern
  • 7,233
  • 5
  • 55
  • 86

0 Answers0