presto
presto copied to clipboard
fix(main/util): fix DeleteNode not having Graphviz visitor
Add basic support for DeleteNode to GraphvizPrinter, preventing stacktrace produced when print DELETE event
Description
Motivation and Context
Fixes #21903
Impact
Prevent stacktraces when printing DELETE event in console
Test Plan
N/A
Contributor checklist
- [x] Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
- [x] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality.
- [ ] If release notes are required, they follow the release notes guidelines.
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.
Release Notes
Please follow release notes guidelines and fill in the release notes below.
== RELEASE NOTES ==
General Changes
* Fixes exception of DeleteNode not having Graphviz vistor
I was following these commits for reference and (cmiiw) am not sure if a unit test is feasible for these ones 🤔
- https://github.com/prestodb/presto/commit/d89b68310564bc44416c29c582a37ddc986054f7
- https://github.com/prestodb/presto/commit/4dc0826f8f727963c7b310f49f290b5f31234f7c
I think just proving that the query doesn't fail is sufficient. Here's an example of using the Graphviz explain plan in a test, please use this as inspiration to create a new test that proves this functionality no longer fails (and perhaps helps us catch other problems with Graphviz rendering): https://github.com/prestodb/presto/blob/e12deb66cbe75d7a10f5812601dfcee868f5f6a3/presto-tests/src/main/java/com/facebook/presto/tests/AbstractTestQueries.java#L2482
Thanks for the lead, Tim! I've added a test to ensure no exception got thrown when trying to get Graphviz-formatted EXPLAIN
result for DELETE event
LGTM. Please modify your commit to conform to our standards (linked in the checklist). Perhaps
Add support for Graphviz rendering of delete nodes
Thanks @tdcmeehan, I've amended the commit message to adhere the guideline
@hainenber could you look into the test failure?
There is this predating PR https://github.com/prestodb/presto/pull/21927/commits/fed9fdd04b4c0d0f1b1bde76adfe259339187cd3 which has same implementation with proper return type returning accepting context
and GraphVizPrinter
instance.