当从斯诺see shell运行查询时,我可以在UI上看到生成的查询id。稍后,如果我必须在历史记录中搜索相同的内容,我希望搜索我可以定义的查询id,或者以某种方式标记查询。
在运行查询时,是否可以创建自己的查询id或标记?
发布于 2018-06-21 14:22:21
发布于 2020-03-17 22:11:50
实际上,您并没有在CLI上提供这个:
如果您有一个script (running_test.sql):
ALTER QUERY_TAG =;/*后面跟着SQL */
然后,以正常的方式调用斯诺cli cli:
-c "CONNECTION_NAME“-f "full_path_to_sql_file”> write_to_log_file
(连接名称是在配置文件中设置的)
或account_details+用户名+密码“-f”full_path_to_sql_file> write_to_log_file
发布于 2021-10-21 14:30:02
可以为帐户、用户或会话设置查询标记。在跟踪跨许多服务的查询行为时,这一点尤其有用。
请注意,将QUERY_TAG设置为更细粒度级别( https://docs.snowflake.com/en/sql-reference/sql/alter-account.html#usage-notes > user > session)。
/*
The following will provide a default query tag to all queries
performed by an account (replace `MY_ACCOUNT` with your account name)
*/
ALTER ACCOUNT MY_ACCOUNT SET
QUERY_TAG = 'Data Warehouse'
;
/*
The following will provide a default query tag to all queries
performed by a user (replace `MY_USER` with your user name)
NOTE: This is more granular than ACCOUNT and will override
default QUERY_TAG
*/
ALTER USER MY_USER SET
QUERY_TAG = 'Data Transformations'
;
/*
The following will provide a query tag to all queries
performed by this session.
NOTE: This is more granular than USER and ACCOUNT and
will override default QUERY_TAG
*/
ALTER SESSION SET
QUERY_TAG = 'Doing this very specific task'
;https://stackoverflow.com/questions/50965558
复制相似问题