query snowflake s3 external file

For a pattern you can use

select t.$1, t.$2 from @mystage1 (file_format => 'myformat', pattern=>'.*data.*[.]csv.gz') t;

The pattern is a regex expression. For a certain file you have to add the file name to the query like this:

select t.$1, t.$2 from @mystage/data1.csv.gz;

If your file format is set in your stage definition, you don’t need the file format-parameter.

More info can be found here: https://docs.snowflake.com/en/user-guide/querying-stage.html

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top