An open API service indexing awesome lists of open source software.

https://github.com/snowflake-labs/openlineage-accesshistory-setup

Guideline to extract table lineage info in OpenLineage format from access history view
https://github.com/snowflake-labs/openlineage-accesshistory-setup

Last synced: 8 months ago
JSON representation

Guideline to extract table lineage info in OpenLineage format from access history view

Awesome Lists containing this project

README

          

# OpenLineage Adapter

## Overview
Guideline to extract lineage info in [OpenLineage](https://github.com/OpenLineage/OpenLineage) format from Snowflake [ACCESS_HISTORY](https://docs.snowflake.com/en/sql-reference/account-usage/access_history.html) view.

## Code Deployment

### OPENLINEAGE_ACCESS_HISTORY View

#### View Defintion

[open_lineage_access_history.sql](https://github.com/Snowflake-Labs/OpenLineage-AccessHistory-Setup/blob/main/open_lineage_access_history.sql) is the script to create the view from [ACCESS_HISTORY](https://docs.snowflake.com/en/sql-reference/account-usage/access_history.html) and [QUERY_HISTORY](https://docs.snowflake.com/en/sql-reference/account-usage/query_history.html)
that outputs each query that accesses tables in the account in OpenLineage [JsonSchema](https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json) specification.

* The view only shows a query that has non-empty value for `query_tag` column in the [query_history](https://docs.snowflake.com/en/sql-reference/account-usage/query_history.html).
* The `namespace` of each record is in the format of `snowflake://-`

#### Prerequisite
Set your account's organization name to the session variable `current_organization` before creating the view and running each query on the view.

###### Example
`set current_organization='my_org';`