u/FlyFlashy2991

Stage Types in Snowflake
▲ 2 r/SnowPro+1 crossposts

Stage Types in Snowflake

https://preview.redd.it/v5kse06d541h1.png?width=1024&format=png&auto=webp&s=f771acec236bb549780cfe743fcd0078e36ef201

Internal Stages (storage managed by Snowflake):

Stage Type Scope Reference Syntax Auto-Created
User Stage One per user; private @~ Yes
Table Stage One per table; tied to table @%tablename Yes
Named Internal Stage Database/schema object; shareable u/stagename No (CREATE STAGE)

External Stages (storage in cloud provider):

Stage Type Storage Location Reference Syntax
Named External Stage AWS S3, Azure Blob, GCS u/stagename

Key Characteristics

  • User stage: Cannot be altered/dropped; not suitable for multi-user loads.
  • Table stage: Cannot load into a different table; no transformations on COPY allowed beyond column reorder.
  • Named stages: Support privileges (GRANT), file formats, and team collaboration.
  • External stages: Require storage integration or credentials; data stays in your cloud account.

Best Practices

  • Use named stages for production pipelines — they support RBAC, file format binding, and reusability.
  • Use storage integrations (not inline credentials) for external stages — more secure, no secret rotation in DDL.
  • Organize files in logical paths (e.g., /year/month/day/) to enable selective loading via PATTERN or path prefixes.
  • Compress files (gzip, bzip2) and size between 100–250 MB compressed for optimal parallel loading.
  • Attach a file format to the stage to avoid repeating format options in every COPY.
  • Use PURGE = TRUE or lifecycle policies to manage staged file retention.
  • Leverage METADATA\$FILENAME for auditing and incremental load tracking.
  • Avoid user stages for shared/automated workflows — no GRANT support.
reddit.com
u/FlyFlashy2991 — 16 hours ago