Trying to get a file from stage into my local storage via Snowflake GET command but command gets greyed out and gives the above error.

CREATE TEMPORARY STAGE my_temp_stage;

COPY INTO @my_temp_stage/output_filex
FROM (SELECT * FROM Table_name)
FILE_FORMAT = ( 
 TYPE='CSV' 
 COMPRESSION=GZIP 
 FIELD_DELIMITER=',' 
 ESCAPE=NONE 
 ESCAPE_UNENCLOSED_FIELD=NONE 
 date_format='AUTO' 
 time_format='AUTO' 
 timestamp_format='AUTO'
 binary_format='UTF-8' 
 field_optionally_enclosed_by='"' 
 null_if='' 
 EMPTY_FIELD_AS_NULL = FALSE 
)  
overwrite=TRUE 
single=FALSE 
max_file_size=5368709120 
header=TRUE;

I'm using the below GET command to load above file into my local

GET @my_temp_stage/my_temp_stage/output_filex_0_0_0.csv.gz file://C:\Users\zn\Downloads;
2

There are 2 best solutions below

1
Alex On

Are you running the command in the Web UI? It is only supported from a driver/connector such as SnowSQL

0
Alexander Klimenko On

It looks like you are running the command in Snowflake worksheet. You can get your files from the internal stage using SnowSQL client.

  1. Download the client: https://developers.snowflake.com/snowsql/
  2. Install it on your PC
  3. Connect to Snowflake using SnowSQL:

3.1. Open a command prompt or terminal window.

3.2. Type snowsql -a <account_identifier> -u <username> and hit enter to start the SnowSQL application. See this doc how to get the account identifier.

3.3. Enter your Snowflake password when prompted

3.4. Run commands: use database <db_name> and use schema <schema_name> to select the db and schema where your internal stage is created

  1. then you can run your command:
GET @my_temp_stage/my_temp_stage/output_filex_0_0_0.csv.gz file://C:\Users\zn\Downloads;