-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Enrich Update information in QueryInfo #24899
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?
Enrich Update information in QueryInfo #24899
Conversation
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.
The implementation you have is limited in scope to specific table Statement types. We also have an existing field in QueryInfo called updateType
for tracing the type of update statement that was made.
IMO we should make changes to start tracing more information in a POJO that we attach during query analysis. I've made a (draft) PR for this - #24933
Please take a look, and feel free to productionize it
@aaneja Will check and implement these changes. |
831efc0
to
9a3f573
Compare
e239b0a
to
3a05f11
Compare
Hi @evanvdia can you rebase? |
3a05f11
to
c85c0fe
Compare
AnalyzerContext analyzerContext = getAnalyzerContext(queryAnalyzer, | ||
metadata.getMetadataResolver(stateMachine.getSession()), new PlanNodeIdAllocator(), new VariableAllocator(), stateMachine.getSession(), query); | ||
QueryAnalysis analysis = queryAnalyzer.analyze(analyzerContext, preparedQuery); | ||
stateMachine.setUpdateInfo(analysis.getUpdateInfo()); |
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.
The core of the change is here - we now run DDL statements through the analyzer and use analysis.getUpdateInfo()
to set the update info
This responsibility to set the correct/apt info about the DDL operation will now rest solely on StatementAnalyzer
c85c0fe
to
7fdebdd
Compare
public class UpdateInfo | ||
{ | ||
private final String updateType; | ||
private final String updateObject; |
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.
DDL statements can stringify what is relevant to them to track and store it in this updateObject
7fdebdd
to
40283b9
Compare
Co-authored-by: Anant Aneja <[email protected]>
40283b9
to
37fc1c3
Compare
Description
Add additional information to about DDL operations to QueryInfo
Motivation and Context
Issue: #24894
updateType tracking in QueryInfo was added in 3715be8
For lineage tracing, we would like to enhance this with additional information about the object(s) we are updating
Impact
User's can track what tables/columns/schemas were operated on in query info and event listener data
Test Plan
CI
Contributor checklist
Release Notes