2

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?

Vimal Dhaduk
  • 994
  • 2
  • 18
  • 43

0 Answers0