Questions tagged [snowflake-task]

To be used for posts related to Snowflake tasks: https://docs.snowflake.com/en/user-guide/tasks-intro.html

125 questions
1
vote
3 answers

how can I add datetime stamp to zip file when unload data from snowflake to s3?

I want to be able to add a timestamp the filename I'm writing to s3. So far I've been able to write files to AWS S3 using example below. Can someone guide me as to how do I go about putting datetime stamp in the file name? copy into …
codeBarer
  • 2,238
  • 7
  • 44
  • 75
1
vote
0 answers

Load GZIP Binary Data in a column in Snowflake DB

I have a csv file which has two columns. First Column is an id and second column is the compressed GZIP binary data. I want to load this record into the Snowflake table with having two columns id as number data type and bin_text as binary data…
1
vote
1 answer

Does snowflake has function LISTAGG(column_name [, delimiter] ON OVERFLOW TRUNCATE )?

It seems "ON OVERFLOW TRUNCATE" feature is not available in snowflake which goes with LISTAGG in Oracle. Is there a alternate function or workaround to it?
npool
  • 111
  • 1
  • 1
  • 7
1
vote
1 answer

Snowflake - copy column headers for empty row

I am using copy into command to store the query results from snowflake into a file in s3 bucket. It works as expected but when the query returns no data I still want to save the column names in the same file so that I can display the empty row with…
Gowthaman
  • 1,262
  • 1
  • 9
  • 15
1
vote
1 answer

insert LAST_QUERY_ID value while inserting data in a table via stored proc in Snowflake

I'm inserting data into Snowflake table via stored proc. I have a column in table where i want to capture the query id when the insert statement will run. Any suggestions how this can be achieved? Cheers,
Kshitij
  • 47
  • 6
1
vote
1 answer

Snowflake Data Pipeline problems - in particular stream issue

Background I have implemented a snowflake data pipeline (s3 log file > SNS > pipe > stage table > stream > task > stored proc/UDF > final table) in our production snowflake database. While things were working on a smaller scale in our dev database,…
1
vote
1 answer

How to use declared variables in INNER SELECT Statement in Snowflake?

How to use SELECT Sub-Query in alias for a column? Here's my script:- /*Declaring variables:*/ SET period= '3'; SET smryseg=concat('sku',$period,'_smry'); SET spend= concat('sku',$period,'') /*Printing it:*/ SELECT $period; /*…
1
vote
1 answer

Can I use snowflake to block downloading data from the client?

End users access snowflake using Tableau, workbench, and cli. The end user looked up the data. The end user wants to save the data retrieved on his computer. Can snowflake prevent end users from saving locally?
1
vote
2 answers

Read parameters from a config file on SnowFlake ( not via SnowSQL )

I am able to read parameters from a local config file on SnowFlake ( using SnowSQL ). But in production environment, SQL will be running in a automated manner (using SnowFlake Tasks). I have created a task in Snowflake which calls a Stored…
Neeraj Kumar
  • 215
  • 3
  • 13
1
vote
3 answers

I'm unable to open snowsql as it is getting errors like ModuleNotFoundError

I got this error after loading snowsql Please help File "PyInstaller/loader/rthooks/pyi_rth_pkgres.py", line 11, in File…
0
votes
1 answer

Load data from Snowflake table to aws s3 in batches for a very large files

I have a task to load a large table from Snowflake to s3. I need to load 1000 records from the table of snowflake in a csv file to s3, and consecutively next 1000 records from the table in another csv file and so on. For example, I have a table of…
0
votes
0 answers

How to Convert SQL code to Snowflake Code

I have the following SQL code.Can you please help convert the following SQL server code to snowflake code.How to extract JSON and use crossapply in snowflake. select vid, ctextid, createdby, Created, description, p.dCode, dense_rank()…
user3369545
  • 310
  • 2
  • 14
0
votes
2 answers

Snowflake date format change

Is there an easy way convert a date format from ('2020-11-17') to November 17,2020 in snowflake. Thanks
Zoom
  • 85
  • 1
  • 11
0
votes
1 answer

Convert MongoDB query to Snowflake

I'm working on a migration project (MongoDB to Snowflake) and trying to convert one of the mongo queries to Snowflake, we have a use case to fetch records if all the elements from an array matched based on the given parameters. Mongo DB Function:…
0
votes
1 answer

Snowflake Timestamp column not loaded using Copy Command

I am using Copy command to load a file in table. It has a timestamp column. In my File format I have defined Timestamp as other and gave value as MM/DD/YYYY HH:MI:SS AM to match with data. When I execute it loads all records which have timestamp…
1 2 3
8 9