The following code sample should ideally return the value of property value but instead returns null. Is this expected? From the spark documentation, it seems any depth query is supported by spark sql and the spark test suite has an example, but unfortunately its for a negative test case.
spark.sql("""select get_json_object('{"node":{"value":"abc"}}', '$..value') as j""").show()
Expected output - abc / Actual - null
I'm trying the any depth path because the json column in every row in the dataset has a variable schema and we're searching for a given key, say foobar, anywhere in the given json, so in the above example, $.value or $.foo.value for more nested values isn't something that's feasible.