The `openlineage-sql` library provides a Python interface to a high-performance Rust library for SQL lineage extraction. It enables parsing SQL queries to identify input tables, output tables, and query types, crucial for data governance and ETL pipeline observability. Currently at version 1.46.0, it is actively maintained with frequent updates reflecting improvements in its core Rust library and broader OpenLineage specification, requiring Python 3.10 or newer.
pip install openlineage-sqlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `parse` function to extract lineage information (inputs, outputs, and query type) from a given SQL query, including DDL statements.
Ensure a Rust toolchain (e.g., rustup) is installed and correctly configured if `pip install` fails with compilation errors.
Simplify complex queries where possible or pre-process dynamic SQL to its final form before passing it to `openlineage-sql`. Validate results for critical lineage paths.
Always treat the return value of `parse` as an object and access its attributes (e.g., `result.inputs`) rather than assuming it's a direct list or dictionary.
No dependency data recorded yet.