Skip to content
Advertisement

I am trying to access the data stored in a snowflake table using python sql. Below is the columns given below i want to access

Below is the data-sample and i want to access columns value,start. This data i dumped in one column(DN) of a table (stg)

##consider many lines stored in same column in different rows.

Below query only fetched data for name. I want to access other columns value also. This query is a part of python script.

Do i need to iterate over data and group? If yes, please suggest the code.

Advertisement

Answer

Here is an example of how to query that data.

Set up sample data:

Select statement example:

Instead of querying individual indexes of the JSON arrays, I think you’ll want to use the flatten function which is documented here.

Here is how you do it with the flatten which is what I am guessing you want:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement