How to convert RDD string(xml format) to dataframe in spark java?

1.3k Views Asked by At

Good solution available in below link if xml data available in file, https://github.com/databricks/spark-xml

Below code convert xml to DataSet by loading physical file..

Dataset<Row> df = sqlContext.read().format("com.databricks.spark.xml")
                                   .option("rowTag", "book")
                                   .load("file:///C:/books.xml");

But If xml data available in JavaRdd then how to convert into Dataset?

0

There are 0 best solutions below