Snowflake : How to create a view on json file on external S3 stage

I am trying to create a view on json file which is placed on external S3 stage of snowflake.
Json file structure is :

[{
‘key1’:val1,
‘key2’:val2
},
{
‘key1’:val1,
‘key2’:val2
}]
I want to query json file with above structure.How can i do this?

Note : I am able to create a view on json file with below structure using flatten function –
{“Data”: {
‘key1’:val1,
‘key2’:val2
},
{
‘key1’:val1,
‘key2’:val2
}}

But now my json structure is different and i don’t have “Data” node in my above json structure.

Leave a Reply

Your email address will not be published. Required fields are marked *