Skip to content

HIVE-28129 Execute statement doesnot report the correct query string information#5155

Merged
ramesh0201 merged 1 commit intoapache:masterfrom
ramesh0201:preparequery
Mar 26, 2024
Merged

HIVE-28129 Execute statement doesnot report the correct query string information#5155
ramesh0201 merged 1 commit intoapache:masterfrom
ramesh0201:preparequery

Conversation

@ramesh0201
Copy link
Contributor

What changes were proposed in this pull request?

Execute Statement should report the correct query string. Because it inherits the conf from the prepare query's sem object, we need to update the query string.

Why are the changes needed?

Because currently execute queries report the prepare statement as their query string in all the logs.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=execute_query_string.q

Copy link
Member

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor comments/questions but not blocking for the patch.

Processor Tree:
ListSink

PREHOOK: query: prepare pcount from select count(*) from src where key > ?
Copy link
Member

Choose a reason for hiding this comment

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

The changes in the .q.out file are the expected ones however there seems to be something missing from the prepare statement implementation. After the changes introduced here the query: prepare pattern does not appear at all in the .q.out files.

Is this normal? Should we log a follow-up ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prepare queries doesn't go through the execution phase as per current implementation https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/Driver.java#L166C30-L166C44
So the pre-execution and post-execution hooks are skipped as well, which is why we miss seeing those results in the q.out file. I feel it is ok. Just that we need to use compilation side hooks to test the prepare queries. explain..prepare still shows up in the q.out files.
So I am not sure if we have to create a follow up to test the prepare queries? what is your take?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation. Let's leave it as is at the moment and if really needed we can create a JIRA later ;)

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@ramesh0201 ramesh0201 merged commit 106c52e into apache:master Mar 26, 2024
@ramesh0201
Copy link
Contributor Author

Thank you @zabetak for the review

dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Sep 25, 2024
…information (apache#5155) (Ramesh Kumar reviewed by Stamatis Zampetakis)
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.

3 participants