I have top level data 'whatever' comprising many (thousands) of records. Each record has data of the form
structA structB ... structN, varA varB ... varN
each structure may also contain other structures and variables e.g. structAA, structAB... varAA, varAB... etc
I would like to query these data and return records meeting a given criteria, for example
SELECT structA.structBC.structNN FROM whatever WHERE structB.structBN.varNN = "value"
Which would return structNN from each record where varNN equals "value"
Databricks will allow me to do something like
SELECT structA FROM whatever as a WHERE a.varN = "value"
but I cant seem to find out if/how one does more levels between SELECT and FROM or after WHERE. I dont particularly want the variable I select-on to be in the structure I return either, so that further complicates things. I suspect the data is accessed as a table which may be part of the problem i.e. I imagine the records as objects but they are columns and rows in some sense. If I cant do this with an SQL query, what can I use in Databricks to achieve the desired result?