Study FAQ
How do a stage, a file format, and a target table work together in a Snowflake load?
Also asked as 2
- What does each object do when I load staged files into Snowflake?
- What do I need before a bulk COPY INTO table can load my files?
Answer
In a Snowflake bulk load, the stage locates the files, the file format tells Snowflake how to parse them, and the target table controls how the parsed fields are stored. Use COPY INTO <table> with an active warehouse. A stage listing confirms that the path is visible. Parsing, column mapping, and type conversion are validated when you sample or load the files.
An internal stage stores files in Snowflake-managed storage. An external stage points to supported cloud object storage. A reusable named stage lets you govern access and keep environment-specific paths in configuration. Prefer a scoped storage integration for private cloud storage. Match the named file format to the actual input type, delimiter, quoting, compression, null representation, and column order or supported name-matching mode.
COPY INTO analytics.raw.orders
FROM @analytics.ingest.orders_stage/incoming/
FILE_FORMAT = (FORMAT_NAME = 'analytics.ingest.orders_csv')
ON_ERROR = ABORT_STATEMENT;
For this example, create the stage, format, and table first. Check container access, USAGE on the warehouse and named file format, the relevant stage access (READ on a named internal stage or USAGE on a named external stage), and INSERT on the target. If an external stage uses a storage integration, its owner or the executing role needs USAGE on the integration as documented. Run LIST against the intended path and check the COPY output and target rows after loading.
Preparing to load data · COPY INTO table · Access control privileges · Storage integrations
Full explanation
Loading Data with Stages, File Formats, COPY INTO, and Snowpipe
Study guide · COF-C03
Read the full explanation