- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 07:55 PM
Hi @robertomatus ,
As per my understanding, It looks like Auto Loader isn't inferring nested structures correctly, likely because of how it handles schema inference differently from spark.read.json().
You can try explicitly defining the schema using .schema() to ensure it recognizes structs properly. If your schema changes over time, enabling schema evolution with .option("cloudFiles.inferColumnTypes", "true") and .option("cloudFiles.schemaEvolutionMode", "rescue") might help.
Alternatively, pre-processing your JSON files with spark.read.json() before using Auto Loader could ensure the correct structure.
Hope this helps! Let me know if you need more details.
Regards,
Brahma