Ecube build SQL tagging
Hello,
We are working with snowflake data source and have requirement to capture meta for ecube build query from data source. Please suggest how I can set query tagging ?
SET QUERY_TAG = "{Team_Name:TEAM, Application:Sisense ecubename}"
I did check pre build plugins but did not get option to set data source session settings or initial sql settings in python script.
Please suggest.
kgupta_egencia
Posted 6 months ago·Last reply 2 weeks ago
3 comments
Edward James
·2 weeks agoThanks for raising this question. SQL tagging and data organization can make a big difference when it comes to maintaining clean, scalable analytics workflows. It's always helpful to see community discussions like this where users share practical solutions and best practices. Hopefully, someone with hands-on experience can provide a clear approach that benefits others facing the same challenge. Good luck, and thanks for starting the conversation!
kgupta_egencia
OP6 months agoThere is additional parameter option in Sisense connection configuration for snowflake, but nothing in documentation what parameter are supported with this option. Please share if any details are available.
Piotr_qbeeq
·6 months agoHello,
Yes, the use case makes sense, but today Sisense doesn’t provide a way to set Snowflake session parameters (like QUERY_TAG) specifically for Elasticube builds.
During an ECube build, Sisense fully manages the Snowflake connection and generates the SQL internally. Pre-build Python plugins don’t have access to the Snowflake session, and there’s no supported hook for “initial SQL” or session-level settings such as:
SET QUERY_TAG = '...'
So unfortunately, you can’t dynamically tag queries per eCube or per build from a plugin.
Recommended workarounds:
Set QUERY_TAG at the Snowflake user level used by Sisense:
ALTER USER SISENSE_USER SET QUERY_TAG = '{"Application":"Sisense","Purpose":"ElasticubeBuild"}';
If you need more granularity, use separate Snowflake users per eCube or environment, each with its own QUERY_TAG.
Both approaches ensure all ECube build queries are tagged, even though the tag can’t be set dynamically.
If per-ECube or per-build tagging is a requirement, this would need to be raised as a feature enhancement on the Sisense side rather than something configurable today.