We have a stored procedure which alter session and set query_tag parameter to some value. When this procedure is called directly through call statement the query tag is setting, whereas when this procedure is called through task, the query tag is not setting. Please suggest.
CREATE OR REPLACE TASK mytask
WAREHOUSE = COMPUTE_WH
SCHEDULE = '1 minute'
AS CALL dummy();
create or replace procedure dummy()
RETURNS VARCHAR(50)
LANGUAGE JAVASCRIPT
EXECUTE AS CALLER
as $$
snowflake.execute( {sqlText: "ALTER SESSION SET QUERY_TAG = 'execute_dummy_proc'" } );
var sql_command = "INSERT INTO mytable(ts) VALUES(CURRENT_TIMESTAMP())";
snowflake.execute ({sqlText: sql_command});
$$;
