cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to convert STRING column into Array of Structs in SQL statement

BamBam
New Contributor II

I have STRING column in a DLT table that was loaded using SQL Autoloader via a JSON file. When I use the "schema_of_json" function in a SQL statement passing in the literal string from the STRING column then I get this output:

ARRAY<STRUCT<firstFetchDate: STRING, lastFetchDate: STRING, matchedObjectArray: ARRAY<STRUCT<highlightSnippet: STRING, matchedObjectAPI: STRING, matchedObjectAttribute: STRING, matchedObjectId: STRING, matchedObjectName: STRING, object: STRING>>, name: STRING, normDetailsAPI: STRING, normId: STRING, object: STRING>>

I am trying to figure out how to get this STRING datatype into a more structure format using a SQL statement.  

Thanks for the help.

0 REPLIES 0
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.