Skip to content

Conversation

tarak271
Copy link
Contributor

@tarak271 tarak271 commented Oct 17, 2025

…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 | +------------+---------------+-------------------+---------------------------------------+--------------------------+------------------------+----------------------------------------------------+----------+---------+--------------------------+-------------------+---------------+

@Aggarwal-Raghav
Copy link
Contributor

@tarak271 , code changes LGTM but I'm not able to see the Txn ID column after cherry-picking your changes in my setup

Screenshot 2025-10-17 at 9 17 03 PM

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 ){
Copy link
Contributor

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 ){

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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

@tarak271
Copy link
Contributor Author

@tarak271 , code changes LGTM but I'm not able to see the Txn ID column after cherry-picking your changes in my setup

Screenshot 2025-10-17 at 9 17 03 PM Do we need to make changes in org.apache.hadoop.hive.ql.processors.ShowProcessListProcessor#getSchema()

@Aggarwal-Raghav yes, made those changes, please try now

Copy link

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