stage_files
Creates, updates, deletes, gets or lists a stage_files
resource.
Overview
Name | stage_files |
Type | Resource |
Id | snowflake.stage.stage_files |
Fields
The following fields are returned by SELECT
queries:
- list_files
A file on a snowflake stage.
Name | Datatype | Description |
---|---|---|
name | string | Name of the file. |
last_modified | string | Date and time when the file was last modified. |
md5 | string | md5 hash of the file. |
size | string | Size of the file. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_files | select | database_name , schema_name , name , endpoint | pattern | List 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.
Name | Datatype | Description |
---|---|---|
database_name | string | Identifier (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. |
endpoint | string | Organization and Account Name (default: orgid-acctid) |
name | string | Identifier (i.e. name) for the resource. |
schema_name | string | Identifier (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. |
pattern | string | A query parameter that filters the command output by a regular expression pattern. |
SELECT
examples
- list_files
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 }}';