cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

databricks spark XML Writer

RobsonNLPT
Contributor

Hi.

I'm trying to generate XML as output base on my nested dataframe. Everything is ok except by I don't know how to add elements to rootTag.

I can add elements from rowtag but not in rootTag. Same problems to add attributes to root 

<books  version = "5.2">
 <library>"LIB1"</library>
 <book id="bk103">
  <author>Corets, Eva</author>
  <title>Maeve Ascendant</title>
 </book>
 <book id="bk104">
  <author>Corets, Eva</author>
  <title>Oberon's Legacy</title>
 </book>
</books>

any help?

 

 

 

2 REPLIES 2

Ayushi_Suthar
Databricks Employee
Databricks Employee

Hi @RobsonNLPT ,Thanks for bringing up your concerns, always happy to help ๐Ÿ˜

Can you please refer to the below document to read and write the XML files?

https://docs.databricks.com/en/query/formats/xml.html

Please let me know if this helps and leave a like if this helps, followups are appreciated.
Kudos
Ayushi

 

Hi Ayushi.

I've checked all official documentation. 

There's no support for rootTag elements and optional rootTag/rowTag

 

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group