Oleg Melnikov
Oleg Melnikov

Reputation: 3298

How to print RowMatrix in Scala/Spark?

How can I view/print to screen a small RowMatrix in Scala?

val A = new RowMatrix(sparkContext.parallelize(Seq(
    Vectors.dense(1, 2, 3),
    Vectors.dense(4, 5, 6))))

Upvotes: 2

Views: 1176

Answers (1)

Oleg Melnikov
Oleg Melnikov

Reputation: 3298

I figured it's just

A.rows.collect

FYI: Beware of the matrix size.

Upvotes: 1

Related Questions