How to export data to a local system from a snow cover data warehouse?

I use a data environment for a cloud of snowflakes, which is similar to a teradata in which data is stored. I can run queries and get results using the web interface itself. But I don’t understand how it is possible to export the results to the local PC so that we can report based on the data.

Thanks in advance

+4
source share
3 answers

You have 2 options that use sfsql, which is based on henplus. The first option is to export the result of your request to an intermediate S3 file, as shown below:

CREATE STAGE my_stage URL='s3://loading/files/' CREDENTIALS=(AWS_KEY_ID=β€˜****' AWS_SECRET_KEY=β€˜****’);
COPY INTO @my_stage/dump
FROM  (select * from orderstiny limit 5) file_format=(format_name=β€˜csv' compression=β€˜gzip'');

Another option is to capture the sql result into a file.

Test.sql:

set-property column-delimiter ","; 
set-property sql-result-showheader off;
set-property sql-result-showfooter off;

select current_date() from dual;

$. / sfsql <test.sql> result.txt

- Snowflake Snowflake, Snowflake. β†’ .

, .

+3

COPY ( ) S3 ( "stage" ), GET, . "sfsql" Snowflake ( -).

"", .

+1

Snowflakes S3 unix-

+1
source

Source: https://habr.com/ru/post/1589128/


All Articles