Snowflake-Labs / OpenLineage-AccessHistory-Setup

Guideline to extract table lineage info in OpenLineage format from access history view
Apache License 2.0
10 stars 5 forks source link

session variables and functions not working in open_lineage_access_history.sql #9

Open Sheeri opened 2 years ago

Sheeri commented 2 years ago

When I did !source open_lineage_access_history.sql

It created a view that contained:

with namespace as ('snowflake://$current_organization-current_account())')

instead of filling in those variables.

I tried to see if I could figure out how to get the session variable for $current_organization and the value of current_account() into the script, but after an hour gave up and just hard-coded the values.

My workaround: change line 12 in the file from:

    select concat('snowflake://', $current_organization, '-', current_account())

to: select 'snowflake://MY_ORG_NAME-MY_ACCOUNT_NAME'

ideal workaround: use snowflake scripting or some other method to get those variables to actually work.