Trying to convert STRING column into Array of Structs in SQL statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 05:18 AM
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.
- Labels:
-
SQL
-
String Column

