Comment
06-11-2024
09:45 PM
06-11-2024
09:45 PM
Hi @AntonioR ,
Thank you, and a very good question.
Session variables are, unfortunately, by their very definition unsafe since they cannot be secured.
Even if we were to support declaring and setting a session variable with complex default there is nothing preventing any user from reading out the value or overwriting it with another.
Do what you want we need to CREATE VARIABLE. That is we need to persist the variable in Unity Catalog and then secure it so that only the owner can update it and only an authorized user can access it.
A created variable still has a session private content, but with a well known definition which can then be used in a SQL UDF or a VIEW.
This is a well known requirement which we hope to address in the future.