0

I'm trying to convert an RDD that has a fixed size lists of strings (a result of parsing CSV file) into and RDD of Rows. This is so I can turn it into a dataframe, because I need it into a dataframe to write to parquet. Anyway the only part I need help with is the converting of Rdd from list of strings to Row.

The RDD variable name is RDD

3
  • 3
    And what have you tried so far ? Commented Feb 16, 2016 at 19:20
  • Ok I converted to Row I used val RowRDD = RDD.map(r => Row.fromSeq(r)) Commented Feb 16, 2016 at 19:37
  • Does this change anything then ? Commented Feb 16, 2016 at 21:22

1 Answer 1

3

I used:

import org.apache.spark.sql._
val RowRDD = RDD.map(r => Row.fromSeq(r))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.