val table1 = session.read
.format("com.databricks.spark.xml").option("rootTag","Table1").option("rowTag","Obs")
.load("file.xml")
val table2 = session.read
.format("com.databricks.spark.xml").option("rootTag","Table1").option("rowTag","Obs")
.load("file.xml")
but instead of 2 distinct tables with 4 record with each 2 columns, I get each time 1 tables with 8 records and 4 columns, as if it didn't take only rows under the root tag ....
rootTag does nothing here. You want to set rowTag to Table1 in one case, and Table2 in the other. You get an array-valued Obs column then. You can also set Root to the rowTag and get both at once.
Hello,
I would like to parse this XML file and obtain 2 spark
Dataset
:<Obs>
elements under<Table1>
tag<Obs>
elements under<Table2>
tagI'm having issues reading this kind of XML to obtain two distinct spark dataframes