Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
gopala000
Frequent Visitor

Ability to query properties from a json column in a DeltaTable

I have a Delta Table that has many columns that are structured and one column that has json stored as a string. Does Fabric has the ability to expose properties in json as table fields to query (like DataBricks). If not, please provide guidance on how to do it.

 

Basically I need to confirm if I need to add columns that I need from json to the data table during ingestion after parsing the json using from_json() and save it to the Delta table or is there a better option available?

 

Looks like parsed json column is stored as Any datatype while the original json column is a string data type. Is there any advantage in storing the parsed json column or should I remove it before saving the table?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gopala000 

 

You can use the from_json() function to parse a JSON string column into a structured format. The specific steps are as follows:

 

Create a new Lakehouse in the Microsoft Fabric workspace, or select an existing Lakehouse.

 

In the Lakehouse, upload your data file and import the data into the Delta table in the Lakehouse.

 

Then select "Open notebook" —> "New notebook"

 

vnuocmsft_0-1736908354355.png

 

Select "Spark SQL"

vnuocmsft_1-1736908393637.png

 

This allows you to extract specific properties from JSON and store them as separate columns.

vnuocmsft_2-1736908595212.png

 

If you need to frequently query specific properties in JSON data, it is recommended to parse the JSON and add the necessary columns during ingestion. This will make querying more efficient and simpler.

 

The parsed JSON column is stored as Any data type, which is useful if you need to preserve the entire JSON structure for future use. However, if you only need specific properties, you may not need to store the parsed JSON column. Instead, you can extract and store only the required properties as separate columns.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @gopala000 

 

You can use the from_json() function to parse a JSON string column into a structured format. The specific steps are as follows:

 

Create a new Lakehouse in the Microsoft Fabric workspace, or select an existing Lakehouse.

 

In the Lakehouse, upload your data file and import the data into the Delta table in the Lakehouse.

 

Then select "Open notebook" —> "New notebook"

 

vnuocmsft_0-1736908354355.png

 

Select "Spark SQL"

vnuocmsft_1-1736908393637.png

 

This allows you to extract specific properties from JSON and store them as separate columns.

vnuocmsft_2-1736908595212.png

 

If you need to frequently query specific properties in JSON data, it is recommended to parse the JSON and add the necessary columns during ingestion. This will make querying more efficient and simpler.

 

The parsed JSON column is stored as Any data type, which is useful if you need to preserve the entire JSON structure for future use. However, if you only need specific properties, you may not need to store the parsed JSON column. Instead, you can extract and store only the required properties as separate columns.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.