Skip to content
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

vdk-impala: Add support for lineage in vdk-impala #932

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

VladimirPetkov1
Copy link
Contributor

Add support for calculating data lineage for jobs that execute SQL queries
against impala.

Lineage is calculated by examining the query plan of the executed query. The
query plan is accessible from the cursor that executed the query, hence no
additional load is present on the target query engine. As this is not very
official way to obtain the query plan there is a risk that this implentation
may break in future impala releases.However the only option was to execute
additional explain statements that would practically double the amount of
executed queries, which could be problematic for loaded environments. Lineage
is calculated only for successfully executed queries that have actually read
or written data from/to the underlying storage.

Implemented functional tests that verify the behaviour with all templates and
simple jobs. As I hit problems starting impala with pytest, I have manually
run the docker compose file and run the tests against that instance.

New feature (non-breaking change which adds functionality)

Signed-off-by: Vladimir Petkov [email protected]

Copy link
Collaborator

@antoniivanov antoniivanov left a comment

Choose a reason for hiding this comment

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

Thanks for making the change.

I made some more high level questions and suggestions which we need to clear up first. I will take a more detailed look at the code later.

@VladimirPetkov1 VladimirPetkov1 force-pushed the person/petkovv/impala-lineage branch 5 times, most recently from 52ade5a to 4791717 Compare August 8, 2022 12:19
Add support for calculating data lineage for jobs that execute SQL queries
against impala.

Lineage is calculated by examining the query plan of the executed query. The
query plan is retrieved by executing RPC call to Impala coordinator after query
execution. The other option was to execute additional explain statements that
would practically double the amount of executed queries, which could be
problematic for loaded environments. Lineage is calculated only for
successfully executed queries that have actually read or written data from/to
the underlying storage.

Implemented functional tests that verify the behaviour with all templates and
simple jobs. As I hit problems starting Impala with pytest, I have bumped the
timeout waiting Impala to start to 120seconds. Wasn't able to make the change
work on python 3.10. Both tests and lineage collection is disabled for python
3.10. Will try to make it work in separate PR.

New feature (non-breaking change which adds functionality)

Signed-off-by: Vladimir Petkov <[email protected]>
@VladimirPetkov1 VladimirPetkov1 enabled auto-merge (squash) August 8, 2022 16:03
@VladimirPetkov1 VladimirPetkov1 merged commit 44ef4d1 into main Aug 8, 2022
@VladimirPetkov1 VladimirPetkov1 deleted the person/petkovv/impala-lineage branch August 8, 2022 16:18
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