'Read different versions of Staged files in aws S3

I have a use case where I have different versions of files in the AWS S3 Stage area. Now I want to read a specific version of these files and load them in snowflake.



Solution 1:[1]

You can use

COPY INTO command.

In your case since there are different versions of the files, it is recommended that you partition the files based on some suffix or prefix. Once this is done you can create an external Stage and point the stage to a specific S3 folder, so you are reading only a particular version of Files from S3. Here you are saving time and cost, as you are scanning only a specific S3 folder which contains the files and not the entire S3 bucket.

More details can be found here - https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#loading-files-directly-from-an-external-location

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anshul Thakur