Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Snowflake CLI (Snowsql) - query tagging

When a query is run from the snowsql shell, i get to see the generated query id on the UI. Later on if i have to search for the same in the history, i want to search the query id that i can define or someway to tag the query.

Is it possible to create my own query id or tag when i run the query?

like image 401
Manikandan Kannan Avatar asked Mar 06 '23 23:03

Manikandan Kannan


1 Answers

You can't create your own query id, but you can use the QUERY_TAG parameter, see here.

You can later use it when scanning the INFORMATION_SCHEMA.QUERY_HISTORY table, see here, it has a QUERY_TAG column. You can also use a Query Tag filter in the History tab in the UI.

You can also use LAST_QUERY_ID to obtain the Snowflake-generated QUERY_ID programmatically. And then you it to filter with that in the QUERY_HISTORY table, and also in the UI.

like image 178
Marcin Zukowski Avatar answered Mar 16 '23 01:03

Marcin Zukowski