-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat: Add OpenLineage support for DatabricksSqlHook #50392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6ed72e6 to
f06b569
Compare
593c1d4 to
2f2eef3
Compare
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Outdated
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/operators/databricks_sql.py
Show resolved
Hide resolved
mobuchowski
left a comment
There was a problem hiding this 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
providers/databricks/src/airflow/providers/databricks/operators/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Outdated
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
2f2eef3 to
1cc14b1
Compare
|
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. |
tatiana
left a comment
There was a problem hiding this 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!
This PR adds OpenLineage support for
DatabricksSqlHookand thereforeDatabricksSqlOperator. 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
DatabricksSqlHookis very similar to all other database Hooks already supported, and implementing a common interface fromDbApiHook: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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.