what is the best practice to pre-load/set a variable based on the active connection to Denodo?
Is this done best by creating a custom function in Java, if yes can you provide an example containing SQL as below.
query current user with his/her attached roles, use that outcome in a case-when of a view.
create temporary table user_roles as (select getsession('user') as msn, getsession('roles') as role from dual());
select msn, case when role = 'relevantrole' then 'Y' else 'N' end as hash_on from
SELECT msn, value as role FROM FLATTEN (user_roles AS v, v.role)
where role = 'relevantrole';