-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29254-Display TxnId associated with the query in show processlis… #6141
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
base: master
Are you sure you want to change the base?
Conversation
@tarak271 , code changes LGTM but I'm not able to see the ![]() Do we need to make changes in org.apache.hadoop.hive.ql.processors.ShowProcessListProcessor#getSchema() |
); | ||
|
||
long txnId = 0; | ||
if(op.queryState != null && op.queryState.getTxnManager() != null ){ |
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.
nit: space after if(
and null ){
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.
Done
private final String runtime; // tracks only running portion of the query. | ||
private final long elapsedTime; | ||
private final String state; | ||
private final long txnId; |
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.
I might be wrong. Don't we need to read this variable in ShowProcessListProcessor.java?
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.
Yes, you are correct. Added getter to use in that class
@Aggarwal-Raghav yes, made those changes, please try now |
|
…t command
What changes were proposed in this pull request?
Display TxnId for each query displayed in show processlist query
Why are the changes needed?
To co-relate TxnId and query
Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Created Junit test case as well as Tested in local cluster
0: jdbc:hive2://ip-10-17-78-194.support.fuse.> show processlist; +------------+---------------+-------------------+---------------------------------------+--------------------------+------------------------+----------------------------------------------------+----------+---------+--------------------------+-------------------+---------------+ | User Name | Ip Addr | Execution Engine | Session Id | Session Active Time (s) | Session Idle Time (s) | Query ID | State | Txn ID | Opened Timestamp (s) | Elapsed Time (s) | Runtime (s) | +------------+---------------+-------------------+---------------------------------------+--------------------------+------------------------+----------------------------------------------------+----------+---------+--------------------------+-------------------+---------------+ | hive | 10.17.78.194 | tez | b6a7a9da-a01e-4e4e-b5bd-38c0edd54867 | 119 | 6 | hive_20251017043354_b66fb35a-0e8c-476a-a48c-0805276cfd40 | RUNNING | 610 | 2025-10-17 04:33:54.639 | 9 | Not finished | +------------+---------------+-------------------+---------------------------------------+--------------------------+------------------------+----------------------------------------------------+----------+---------+--------------------------+-------------------+---------------+