Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

OpenLineage SQL Parser

A library that extracts lineage from SQL statements.

Usage

If you're using OpenLineage integration, there's good chance that you're already using this integration.

This library is implemented in Rust and provides a Python and Java interface. The Rust implementation has not yet been published to Cargo. The interface is explained in INTERFACE.md.

Supported Dialects

The parser supports several dialects. For an up-to-date list of supported dialects, please refer to dialect.rs, specifically the function get_dialect.

The supported dialects are:

  • ansi
  • bigquery
  • hive
  • mysql
  • mssql
  • postgres
  • redshift
  • snowflake
  • sqlite

Support for a generic dialect is also provided.

Installation

Python

$ pip install openlineage-sql 

To install from source, you need to have a Rust toolchain.

curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

You can run Cargo tests then:

cargo test

To build a Python wheel for your system and architecture, you need a Maturin build system. It's recommended to install this in a virtualenv.

cd iface-py
python -m pip install maturin
maturin build --out ../target/wheels

You can verify that the library has been properly built by running:

pip install openlineage-sql --no-index --find-links ../target/wheels --force-reinstall
python -c "import openlineage_sql"

Java

To build the Java interface run the following script from ./iface-java directory:

./script/build.sh

This produces an openlineage-sql.jar in the iface-java/target directory.

The interface can be manually tested by running the integration test from the iface-java directory. When no arguments are provided, the test runs in interactive mode.

./src/test/integration/run_test.sh [sql]

Java Versions

Works on Java 17

./gradlew build fails on Java 21

Todo:

  • Support a larger part of the SQL language
  • Python as a Cargo feature
  • Explore a Java integration

SPDX-License-Identifier: Apache-2.0
Copyright 2018-2026 contributors to the OpenLineage project