Coder Social home page Coder Social logo

arungotur / data-lineage-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cristiscu/data-lineage-tool

0.0 0.0 0.0 2.18 MB

Queries the ACCESS_HISTORY and QUERY_HISTORY views, from the SNOWFLAKE.ACCOUNT_USAGE schema, and generates two interactive GraphViz visual diagrams online, in a visual editor: one for column lineage, the other for table lineage.

License: Creative Commons Zero v1.0 Universal

Python 100.00%

data-lineage-tool's Introduction

Data Lineage Viewer for Snowflake

Queries the ACCESS_HISTORY and QUERY_HISTORY views, from the SNOWFLAKE.ACCOUNT_USAGE schema, and generates two interactive GraphViz visual diagrams online, in a visual editor:

The generated DOT Graphviz models are also saved in the output/ folder.

The Query Result for the Lineage Graph

To repro, you may run the sql/create-script.sql file in Snowflake, which is similar to the one described in the documentation samples. Wait a few hours, until the changes are propagated in the ACCOUNT_USAGE views.

Then run the sql/query-access-history.sql query to get lineage info about the created test tables. {{database}} must be replaced by TEST_DB for our use case here:

Table Lineage

The Column Lineage Graph

This diagram shows how data moved between the table columns in the TEST_DB database. You may go over the links and the SQL query that made that transformation appears as tooltip.

Table Lineage

The Table Lineage Graph

The table lineage graph is a simplified derived diagram, in which there are no columns, and all column dependencies appear as one single link at the container table level:

Table Lineage

Database Profile File

To connect to Snowflake, create a profiles_db.conf copy of the profiles_db_template.conf file, and customize it with your own Snowflake connection parameters, the user name and the account. Your top [default] profile is the active profile, considered by our tool.

Save your password in a SNOWFLAKE_PASSWORD local environment variable. Never add the password or any other sensitive information to your code or to profile files. All names must be case sensitive, with no quotes.

CLI Executable File

Without an executable, you can use the source file directly:

python data-lineage.py TEST_DB

To compile into a CLI executable:

pip install pyinstaller
pyinstaller --onefile data-lineage.py
dist/data-lineage TEST_DB

data-lineage-tool's People

Contributors

cristiscu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.