Hi Hyukjin,
I have created the below issue.
https://github.com/databricks/spark-xml/issues/155
Sent from Mail for Windows 10
From: Hyukjin Kwon
gt;
> Please suggest. Thanks in advance.
>
>
>
> Thanks,
>
> Sreekanth
>
>
>
> *From:* Sreekanth Jella [mailto:srikanth.je...@gmail.com]
> *Sent:* Sunday, August 14, 2016 11:46 AM
> *To:* 'Hyukjin Kwon'
> *Cc:* 'user @spark'
> *Subje
Hi Experts,
Please suggest. Thanks in advance.
Thanks,
Sreekanth
From: Sreekanth Jella [mailto:srikanth.je...@gmail.com]
Sent: Sunday, August 14, 2016 11:46 AM
To: 'Hyukjin Kwon'
Cc: 'user @spark'
Subject: Re: Flattening XML in a DataFrame
Hi Hyukjin Kwon,
Hi Hyukjin Kwon,
Thank you for reply.
There are several types of XML documents with different schema which needs to
be parsed and tag names do not know in hand. All we know is the XSD for the
given XML.
Is it possible to get the same results even when we do not know the xml tags
like manager
Hi Sreekanth,
Assuming you are using Spark 1.x,
I believe this code below:
sqlContext.read.format("com.databricks.spark.xml").option("rowTag",
"emp").load("/tmp/sample.xml")
.selectExpr("manager.id", "manager.name",
"explode(manager.subordinates.clerk) as clerk")
.selectExpr("id", "name", "c