Any one follow the following links before about xml https://github.com/databricks/spark-xml

I just keep having problem on importing import com.databricks.spark.xml._

Error

enter image description here

My databricks version

enter image description here

Actually I also want to know how to install the package

$SPARK_HOME/bin/spark-shell --packages com.databricks:spark-xml_2.12:0.5.0

2 Answers

0
Venky On

Use this dependency in Android Studio:

// https://mvnrepository.com/artifact/com.databricks/spark-xml
compile group: 'com.databricks', name: 'spark-xml_2.12', version: '0.5.0'

For further assistance, follow this link:

https://mvnrepository.com/artifact/com.databricks

0
Ritesh On

You can install package/library by using import library option available in databricks homepage.

databricks-homepage

Here choose maven option and give maven coordinates or you have the privilege to search package as well

maven

enter image description here

After this you need to attach the library to your cluster by navigating Clusters>Libraries. Now you can directly use this library as below without importing it.

df = spark.read.format('com.databricks.spark.xml').options(rowTag='book').load(' /FileStore/tables/sample.xml')