We have an aws s3 bucket where same file is getting rewritten every day. And we need to load that file in snowflake which is only loaded today.
Copy command is just working fine. however when a new file is not loaded it just load the previous one which is not needed. instead it should throw an error for the team to know.
We can query the last_modified date:
ls @stage_name
or we can get the stage metadata information.
By query
select metadata@filename from @stage_name
But I am not able to find any way of querying or filtering last_modified
column of stage.
COPY INTO
command you are using? I don't think your issue is with the last_modified date, but rather how you are handling errors in theCOPY
command. – Mike Walton