Forum Discussion
Import data from nested XML into fabric delta tables
I have a requirement where i have complex nested XML and i want to explode the same into multiple tables by establishing primary and foreign key relation. How can i achieve the same in fabric. Can we use dataflow gen2 or notebooks would be correct option to do it. Please note nesting can go upto 30+ levels.
Thank you. It works.
4 Replies
- Ugk161610Super User
Ymatole ,
For very deeply nested XML (20–30+ levels) use notebooks (PySpark) in Fabric — not Dataflow Gen2. Dataflow Gen2 is OK for light/medium hierarchies, but for extreme nesting it becomes hard to maintain and fragile. Notebooks give full control, better performance and easier error handling.
Why notebooks / Spark:
You can use the spark-xml parser to read XML into DataFrames and then programmatically flatten/explode nodes
- You can handle dynamic/irregular schemas, recursion, and very deep nesting with code (loops or recursion), which a UI pipeline struggles with.
- Spark scales and writes directly to Delta tables so you can create normalized tables with PK/FK relationships.
- Easier to add surrogate keys, audit columns, and incremental processing.
Small PySpark example (conceptual):
GopiKrishna
- YmatoleFrequent Visitor
Thank you. It works.
- v-prasareCommunity Support
Hi Ymatole,
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
Ugk161610, Thanks for your prompt response
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support - v-prasareCommunity Support
Hi @Ymatole,
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support