Skip to main content

stage_files

Creates, updates, deletes, gets or lists a stage_files resource.

Overview

Namestage_files
TypeResource
Idsnowflake.stage.stage_files

Fields

The following fields are returned by SELECT queries:

A file on a snowflake stage.

NameDatatypeDescription
namestringName of the file.
last_modifiedstringDate and time when the file was last modified.
md5stringmd5 hash of the file.
sizestringSize of the file.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_filesselectdatabase_name, schema_name, name, endpointpatternList files in the stage -- this is equivalent to LIST @stage.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_namestringIdentifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
endpointstringOrganization and Account Name (default: orgid-acctid)
namestringIdentifier (i.e. name) for the resource.
schema_namestringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.
patternstringA query parameter that filters the command output by a regular expression pattern.

SELECT examples

List files in the stage -- this is equivalent to LIST @stage.

SELECT
name,
last_modified,
md5,
size
FROM snowflake.stage.stage_files
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND pattern = '{{ pattern }}';