Skip to content

feat: Consume SQL hook lineage in OpenLineage#62171

Merged
mobuchowski merged 2 commits into
apache:mainfrom
kacpermuda:feat-ol-sql-hll
Feb 24, 2026
Merged

feat: Consume SQL hook lineage in OpenLineage#62171
mobuchowski merged 2 commits into
apache:mainfrom
kacpermuda:feat-ol-sql-hll

Conversation

@kacpermuda

Copy link
Copy Markdown
Collaborator

Followup to #61535, this PR updates the OpenLineage listener to include SQL lineage reported by hooks.

For each SQL query, it parses inputs/outputs via the existing SQLParser, enriches facets (SQL job, external query), and emits dedicated START/COMPLETE (or FAIL) child OpenLineage events. When exactly one query was executed, the parsed metadata is also merged into the parent task's lineage event, for simplicity (but the separate events are always emitted).

Updated documentation template and Sphinx extension to better describe hook-level lineage capabilities and discover these new sql hook lineage hooks.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Cursor following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@mobuchowski mobuchowski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, looks good anyway - but a question about the single/multiple events

Comment thread providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py Outdated
Comment thread providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py Outdated
Comment thread providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py Outdated
Comment thread providers/openlineage/src/airflow/providers/openlineage/utils/sql_hook_lineage.py Outdated
Comment thread devel-common/src/sphinx_exts/templates/openlineage.rst.jinja2
@potiuk

potiuk commented Feb 24, 2026

Copy link
Copy Markdown
Member

I'd love @mobuchowski does the final review before I start new release (today?)

@mobuchowski mobuchowski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue, good otherwise

Comment thread providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py Outdated
@mobuchowski mobuchowski self-requested a review February 24, 2026 17:51
@mobuchowski mobuchowski merged commit 27426e4 into apache:main Feb 24, 2026
125 checks passed
@kacpermuda kacpermuda deleted the feat-ol-sql-hll branch February 24, 2026 19:35
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
* feat: Consume SQL hook lineage in OpenLineage

* Update providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py

---------

Co-authored-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
Ankurdeewan pushed a commit to Ankurdeewan/airflow that referenced this pull request Mar 15, 2026
* feat: Consume SQL hook lineage in OpenLineage

* Update providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py

---------

Co-authored-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants