In order to upload data in files to Snowflake, you need to use a stage: external or internal. External stages are paths to external storage buckets (and need to be created). Internal stages are: by user, by table, and named created objects.
- Stages allow folders. In fact, you can point specifically to files (Loading Data — Snowflake Documentation).
- Can be automatically deleted when running a COPY INTO:
Files that were loaded successfully can be deleted from the stage during a load by specifying the PURGE copy option in the COPY INTO command (https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html)
Permission
- We cannot allow users to easily use table stages since they require ownership privileges (and only one role can have ownership).
- I wouldn’t want to need named stages, since we would need to manage them.
- How can I monitor user stages to avoid problems? Is this enough? STORAGE_USAGE View — Snowflake Documentation . In any case, this is a problem I already have: I cannot prevent a user from using its stage, so I need to monitor stages.