cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Dataframe into Nested xml

PriyaTech
New Contributor

e.g.

dataframe is having firstname,lastname,middlename,id,salary

I need to convert dataframe in xml file but in nested format.

output as nested xml

<Name>

    <firatname>

<middlename>

    <lastname>    

</Name>

<id></id>

<salary></salary>

Anyone has ides hot to achieve this.

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

databricks has a xml connector:

https://docs.databricks.com/data/data-sources/xml.html

Basically you just define a df with the correct structure and write it to xml.

To create a nested df, here you can find some info.

View solution in original post

1 REPLY 1

-werners-
Esteemed Contributor III

databricks has a xml connector:

https://docs.databricks.com/data/data-sources/xml.html

Basically you just define a df with the correct structure and write it to xml.

To create a nested df, here you can find some info.

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