A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/developer-guide/python-connector/../../sql-reference/sql/list below:

Website Navigation


LIST | Snowflake Documentation

LIST

Returns a list of files that have been staged (files that have been uploaded from a local file system or unloaded from a table) in one of the following Snowflake stages:

LIST can be abbreviated to LS.

See also:

REMOVE

PUT , COPY INTO <table>

COPY INTO <location> , GET

Syntax
LIST { internalStage | externalStage } [ PATTERN = '<regex_pattern>' ]

Copy

Where:

internalStage ::=
    @[<namespace>.]<int_stage_name>[/<path>]
  | @[<namespace>.]%<table_name>[/<path>]
  | @~[/<path>]

Copy

externalStage ::=
    @[<namespace>.]<ext_stage_name>[/<path>]

Copy

Required parameters
internalStage | externalStage

Specifies the location where the data files are staged:

@[namespace.]int_stage_name[/path]

Files are in the specified named internal stage.

@[namespace.]ext_stage_name[/path]

Files are in the specified named external stage.

@[namespace.]%table_name[/path]

Files are in the stage for the specified table.

@~[/path]

Files are in the stage for the current user.

Where:

Note

If the stage name or path includes spaces or special characters, it must be enclosed in single quotes (e.g. '@"my stage"' for a stage named "my stage").

Tip

Specifying a path provides a scope for the LIST command, potentially reducing the amount of time required to run the command.

Optional parameters
PATTERN = 'regex_pattern'

Specifies a regular expression pattern for filtering files from the output. The command lists all files in the specified path and applies the regular expression pattern on each of the files found.

Usage notes Output

The command returns the following columns:

Column

Data type

Description

name

VARCHAR

Name of the staged file.

size

NUMBER

Size of the file compressed (in bytes).

md5

VARCHAR

The MD5 column stores an MD5 hash of the contents of the staged data file.

For internal stages with default encryption (SNOWFLAKE_FULL), during upload the source file is encrypted with a random key, and its resulting MD5 digest will always differ from the original local file.

Amazon S3 stages report the value via the S3 eTag field, which might not be an MD5 hash of the file contents.

For Google Cloud stages that use a customer-managed encryption key (CMEK), md5 is expected to be NULL.

For more information, see Customer-managed encryption keys.

last_modified

VARCHAR

Timestamp when the file was last updated in the stage.

Examples

List all the files in the stage for the mytable table:

List all the files in the path1 path of the mystage named stage:

List the files that match a regular expression (i.e. all file names containing the string data_0) in the stage for the mytable table:

LIST @%mytable PATTERN='.*data_0.*';

Copy

List the files in the /analysis/ path of the my_csv_stage named stage that match a regular expression (i.e. all file names containing the string data_0):

LIST @my_csv_stage/analysis/ PATTERN='.*data_0.*';

Copy

Use the abbreviated form of the command to list all the files in the stage for the current user:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4