Forum Discussion
Ymatole
8 months agoFrequent Visitor
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...
- 8 months ago
Thank you. It works.
Ugk161610
8 months agoSuper 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
Ymatole
8 months agoFrequent Visitor
Thank you. It works.