Hi,

I need to flatten a nested dataframe and I' following this example:
https://docs.databricks.com/spark/latest/spark-sql/complex-types.html

Just wondering:
1. how can I test for the existence of an item before retrieving it
Say test if "b" exists before adding that into my flat dataframe

events = jsonToDataFrame("""{  "a": {    "b": 1,

"c": 2,

  }}""")


2.



Does anyone know of any examples of how to do these tasks?

Thanks!
Zeming

Reply via email to