Skip to content

HIVE-28623: Implement RuntimeContext to decouple runtime data from TezTask#5538

Merged
abstractdog merged 5 commits intoapache:masterfrom
abstractdog:HIVE-28623
Dec 18, 2024
Merged

HIVE-28623: Implement RuntimeContext to decouple runtime data from TezTask#5538
abstractdog merged 5 commits intoapache:masterfrom
abstractdog:HIVE-28623

Conversation

@abstractdog
Copy link
Contributor

@abstractdog abstractdog commented Nov 12, 2024

What changes were proposed in this pull request?

Encapsulate runtime related info to a separate class for later usage.

Why are the changes needed?

Code refactor.

Does this PR introduce any user-facing change?

No.

Is the change a dependency upgrade?

No.

How was this patch tested?

Easy refactor, precommit tests should pass.

@abstractdog
Copy link
Contributor Author

cc: @tanishq-chugh , @ayushtkn
this is the implementation which is brought from the WIP query history


public void setPlan(QueryPlan plan) {
this.plan = plan;
TezTask task = Utilities.getFirstTezTask(plan.getRootTasks()).orElse(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

@abstractdog After query run completes, when resources are being released by the driver, plan is being set to null and it is causing NullPointerException here, which is present as part of DEBUG logs.

Copy link
Contributor Author

@abstractdog abstractdog Nov 14, 2024

Choose a reason for hiding this comment

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

I see, can you point me to the logs that show this?
btw I made a slight refactor in this area after pushing the original, working version that I used in case of the query history...NPE looks weird as we obtain a reference to the RuntimeContext in setPlan...I guess there are calls when the passed plan is already null, need to null-check I guess

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure
temp.txt

Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't cause any issue wrt query execution but just some noise in logs. a null check wrt plan should just be fine.. i guess the one test failure in precommit is as well linked to this ;)

// only set runtimeContext if the plan is not null
// we don't want to nullify runtimeContext if this method is called with plan=null, which is the case when e.g.
// driver.releasePlan() tries to release resources/objects that are known to be heavy
if (plan != null){
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing space between ){

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, let me reformat

@difin
Copy link
Contributor

difin commented Dec 4, 2024

LGTM +1

@abstractdog
Copy link
Contributor Author

LGTM +1

thanks for the review, pushed one more commit to address that

@abstractdog
Copy link
Contributor Author

thanks @deniskuzZ, addressed comments in cd39182

Copy link
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

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

+1

@sonarqubecloud
Copy link

@abstractdog abstractdog merged commit f44e1be into apache:master Dec 18, 2024
5 checks passed
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.

5 participants