- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 10:38 AM
Hi there, as I'm learning more about schemaHints, it seems like an incredibly useful way to unpack some of my json data. However, I've hit what is either a limitation of schemaHints or of my understanding of how to use it properly.
Below I have an example of a somewhat standard read_files query. However, rather than applying schemaHints to a single nested structure, I would like to apply a schemaHints pattern to multiple nested fields inside *all* structs inside a given sub_data field (e.g. everything inside elementData.element.data.*).
However, when I try using the `*` wildcard, I quickly get an error:
The only way I've seen so far to get close to (but not quite) where I'm wanting to get, is I can apply a double map<string,string> on the data field, like so:
But the challenge is I want to map two separate sub-fields (dataPoint & values).
If I try to triple map, I lose either the dataPoint field or the values field (depending on how I map it):
e.g. Mapping dataPoint properly (but values is lost)
e.g. Mapping values properly (but dataPoint is lost)
Any feedback/input on this would be much appreciated!
+Side-note: Props to @genevive_mdonça for your post Handling Complex Nested JSON in Databricks Using s... - Databricks Community - 116210. This was a great springboard!