Collect events from query planner for reporting to query completion events#7134
Collect events from query planner for reporting to query completion events#7134raunaqmorarka wants to merge 4 commits intotrinodb:masterfrom
Conversation
There was a problem hiding this comment.
are the warnings cleared now from the collector?
(this is how i understand the point in returning WarningsMatcher directly from the matches or doesNotFire)
There was a problem hiding this comment.
Warnings are not cleared from the collector. I picked this way as it seemed cleaner than sending list of expected warnings into matches or doesNotFire.
...no-main/src/test/java/io/trino/sql/planner/iterative/rule/TestApplyTableScanRedirection.java
Outdated
Show resolved
Hide resolved
...no-main/src/test/java/io/trino/sql/planner/iterative/rule/TestApplyTableScanRedirection.java
Outdated
Show resolved
Hide resolved
|
@sopel39 @raunaqmorarka should the warnings be unconditional or suppressable with a config? |
Currently we leave it to the UIs or tools using trino to choose to ignore all warnings or warnings with certain error codes. I think only the trino-cli shows all warnings always. |
e52c0be to
b0694e4
Compare
|
mind test failures |
b0694e4 to
c913468
Compare
yup, pushed fix for one now |
|
Why would we want to add a warning for this? Warnings are meant for telling the user about a potentially problematic event that they might want to address. The "redirection" is just an optimization, similar to any rewrite the optimizer would do. |
We wanted some way to inform the user about redirection, using warning collector is not ideal but it seems to be the only way available currently. This type of warning message was also planned for the hive to iceberg table redirection feature. Is there a better alternative for surfacing this information to the user ? |
phd3
left a comment
There was a problem hiding this comment.
@martint fwiw, based on the review so far on #7016 so far, we're also adding a similar warning there. That's not necessarily an "optimization" though.
Warnings are meant for telling the user about a potentially problematic event that they might want to address.
IMO such warnings can be especially useful when something goes wrong. i.e. a query scanning SELECT * FROM T fails with error saying "There's some issue with table S" at later stage, a warning along with it could clarify things for end user. (I get your point on calling something like this a "warning" though, but can't think any other mechanism.)
|
@martint are you okay to land this? |
No, I don't think we should use warnings for that purpose. Warnings are highly visible -- they show up on the CLI and any tools that understand how to render them. If we need to capture debugging information, that should be somehow attached to the query completion events. If it's to be able to diagnose an error, then it should be provided as part of the error. |
@martint would it be reasonable to extend WarningCollector with |
|
I talked with @martint and the best approach would be to report redirections in in event listener. |
We still need a mechanism to propagate this information from the optimizer rule to event listener. For that we have to get the necessary info into QueryInfo. I could see a couple of ways of doing it:
|
|
I think we could:
Alternatively, we could add something like but it doesn't look very nice. I don't think we should add another |
c913468 to
89e8173
Compare
89e8173 to
dd1cba7
Compare
|
This PR adds a concept of "query event". Please update the title accordingly. What's the longer term plan for this? We should have an issue tracking this effort where people can check progress. Also, from design perspective, it seems weird to track warnings and events as parallel data structures. |
For now the idea is to just report the "events" into query completion events and the query info json. |
so this sounds more like a DEBUG-level info / event. anyway, i thinking warnings and this new type of events should be collected together, in one bag, and propagated back to clients together for certain reasons (coordinator's memory footprint, web ui) we cannot generate large number of these lower-level events anyway, so this shouldn't be the driving factor |
|
👋 @phd3 - this PR has become inactive. We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks. |
|
Gonna close this one out due to inactivity, please reopen if you would like to continue doing work here. |
No description provided.