Hubert-Dudek
Databricks MVP

Hi @Abhishek Tomar​ , If you want to get it from Cosmos DB, use the connector with a custom query https://github.com/Azure/azure-cosmosdb-spark

If you want to have JSON imported directly by databricks/spark, please go with the below solution:

SELECT
  ReportId,
  ReportName,
  in_network.price as price,
  Explode(in_network.provider) as provider
From
(SELECT
  ReportId,
  ReportName,
  Explode(in_network) as in_network
FROM
  my_json);

image.png 


My blog: https://databrickster.medium.com/

View solution in original post