Skip to content

HIVE-26167: QueryStateMap in SessionState is not maintained correctly#3234

Merged
lcspinter merged 1 commit intoapache:masterfrom
lcspinter:HIVE-26167
Apr 30, 2022
Merged

HIVE-26167: QueryStateMap in SessionState is not maintained correctly#3234
lcspinter merged 1 commit intoapache:masterfrom
lcspinter:HIVE-26167

Conversation

@lcspinter
Copy link
Contributor

What changes were proposed in this pull request?

Add the current querystate object to SessionState's QueryStateMap if it's missing.

Why are the changes needed?

Many unit tests are initializing the driver object once, but reusing it for all the query executions in the whole test method. Since the queryStateMap in the SessionState is cleared after the first query execution, all subsequent queries will not be able to access the querystate through the SessionState.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual test, unit test

@marton-bod
Copy link
Contributor

The patch looks good, but one question: when we send in a statement via SQL in the normaly way, where does the query state get initialized?

@lcspinter
Copy link
Contributor Author

The patch looks good, but one question: when we send in a statement via SQL in the normaly way, where does the query state get initialized?

It is initialized in the driver constructor.

@lcspinter lcspinter changed the title HIVE-26167: QueryStateMap in SessionState is maintained correctly HIVE-26167: QueryStateMap in SessionState is not maintained correctly Apr 25, 2022
@lcspinter lcspinter merged commit de44b37 into apache:master Apr 30, 2022
@lcspinter lcspinter deleted the HIVE-26167 branch April 30, 2022 15:05
DongWei-4 pushed a commit to DongWei-4/hive that referenced this pull request Oct 28, 2022
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
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