Skip to content

Conversation

@kacpermuda
Copy link
Contributor

This PR adds OpenLineage support for DatabricksSqlHook and therefore DatabricksSqlOperator. It also introduces caching the hook on the operator level and gathering Databricks query_ids in the Hook when executing queries.

The OpenLineage logic implemented in DatabricksSqlHook is very similar to all other database Hooks already supported, and implementing a common interface from DbApiHook:

  • Snowflake implementation url.
  • Redshift implementation url.
  • All supported hooks url

This PR also implements a very similar logic as in Snowflake provider on how to deal with multiple query_ids - we are sending pair of OpenLineage events for each query run, if there are more than one per operator run.

I've also updated the OpenLineage documentation to make it clear for the users how the support works for operators that inherit from SqlExecuteQueryOperator.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copy link
Contributor

@mobuchowski mobuchowski left a comment

Choose a reason for hiding this comment

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

Approved with non-blocking nits

@kacpermuda kacpermuda force-pushed the feat-dbt-hook-ol-support branch from 2f2eef3 to 1cc14b1 Compare May 12, 2025 10:54
@kacpermuda
Copy link
Contributor Author

Thank you all for the input, I've answered all the comments and CI is green. Let me know if there is anything else that needs explanation or it's good to merge.

@mobuchowski @tatiana @eladkal

Copy link
Contributor

@tatiana tatiana left a comment

Choose a reason for hiding this comment

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

Thanks, @kacpermuda , for being so quick on replying and giving all the numbers!

@mobuchowski mobuchowski merged commit f7e350d into apache:main May 12, 2025
96 checks passed
@kacpermuda kacpermuda deleted the feat-dbt-hook-ol-support branch May 12, 2025 13:29
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.

4 participants