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
9
votes
3 answers

Is there a way to force run a Snowflake's TASK now (before the next scheduled slot)?

I have a task scheduled to run every 15 minutes: CREATE OR REPLACE TASK mytask WAREHOUSE = 'SHARED_WH_MEDIUM' SCHEDULE = '15 MINUTE' STATEMENT_TIMEOUT_IN_SECONDS = 3600, QUERY_TAG = 'KLIPFOLIO' AS CREATE OR REPLACE TABLE mytable AS …
RubenLaguna
  • 21,435
  • 13
  • 113
  • 151
9
votes
2 answers

Significance of Constraints in Snowflake

Snowflake allows UNIQUE, PRIMARY KEY, FOREIGN KEY and NOT NULL constraints but I read that it enforces only NOT NULL constraint. Then what is the purpose of other keys and under what circumstances do we have to define them? I appreciate any…
6
votes
4 answers

dbt to snowflake connections fails via profiles.yml

I'm trying to connect to snowflake via dbt but connections fail with the error below: Using profiles.yml file at /home/myname/.dbt/profiles.yml Using dbt_project.yml file at…
Ravi
  • 203
  • 1
  • 3
  • 6
4
votes
2 answers

Snowflake Alert Long Running Queries

How to alert long running queries, to multiple users in snowflake ? Right now the alert is sent only to the account admin role user. Is there any way to notify the long query alert to "the user running the query OR notify to multiple users belong…
4
votes
4 answers

Execution of SQL Statements inside Stored Procedure in Parallel in SnowFlake DB

In SnowFlake, would there be any option to execute the sql statements in parallel inside a Stored Procedure. I've a Stored Procedure (shown below), which has 35 sql statements, which run sequentially. We are planning to reduce the time , thinking…
4
votes
1 answer

How to connect with snowflake using sso authentication using DBT

I am trying to connect with snowflake using DBT with SSO Authentication Mechanism. For this an external browser window should open for passing the credentials. To connect with snowflake I build the profile.yml file as below test_dbt_snowflake: …
4
votes
1 answer

Flatten data source in Snowflake from Array

I am trying to fix an array in a dataset. Currently, I have a data set that has a reference number to multiple different uuids. What I would like to do is flatten this out in Snowflake to make it so the reference number has separate row for each…
3
votes
1 answer

Return only last statement from Snowflake SQL query to R

I've got a Snowflake SQL query I'm trying to execute in R via ODBC connection that looks like this SET quiet=TRUE; USE SOMEDATABASE.SOMESCHEMA; --Select timestamp of last sale per customer DROP TABLE IF EXISTS sales; CREATE TEMPORARY TABLE…
3
votes
1 answer

How to run snowflake side effect functions like SYSTEM$GENERATE_SCIM_ACCESS_TOKEN within a procedure with owner rights?

Basically I want to do SCIM integration in snowflake. For that I have to use this command for getting the token which will be passed to Azure AD: call system$generate_scim_access_token(''); This command can only run with AccountAdmin. And…
3
votes
1 answer

Passing variables from predecessor task to Current task

Is there a way to set variables in Task 1 and pass them to the child task? It looks like every task has a different session so value of variable doesn't transfer in a task tree.
vinny
  • 55
  • 6
3
votes
1 answer

Lateral Flatten Snowpipe data with mixture of arrays and dict

I have two different structured json files being piped in from a snowpipe. The only difference is that instead of a nested dict it has many nested arrays. I am trying to figure out how to transform structure 1 into one finalized table. I've…
3
votes
1 answer

Alter column set default unsupported feature

I want to alter the table and set the default sequence of a column which is identity. When I try to run ALTER TABLE report.test_table MODIFY id set default test_table_seq.NEXTVAL; it shows following error: [0A000][2] Unsupported feature 'Alter…
3
votes
1 answer

How do you find suspended tasks in Snowflake DB?

I want to find out the suspended tasks, the output of SHOW TASKS is too long to quickly eyeball which tasks are actually suspended (We have lots of tasks) Is there any way to just get the names of the tasks that are suspended and filter out the…
RubenLaguna
  • 21,435
  • 13
  • 113
  • 151
3
votes
3 answers

Resuming tasks: Unable to update graph with root task *XXXX* since that root task is not suspended

I am trying to build some tasks to automate some of my processes. I have included the code for my tasks which execute successfully and have tested out manually, it achieves the correct end result. Also, please forgive my lack of SQL etiquette, just…
Bigmoose70
  • 453
  • 6
  • 15
2
votes
1 answer

getting error while calling sowflake external function from one database to another database

I have created a external function in one database and calling that function in another database. am getting error as internal server error. Do we have any limitation on calling snowflake external function accorss the database. I called the function…
1
2 3
8 9