presto icon indicating copy to clipboard operation
presto copied to clipboard

fix(main/util): fix DeleteNode not having Graphviz visitor

Open hainenber opened this issue 1 year ago • 6 comments

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

hainenber avatar Feb 13 '24 11:02 hainenber

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

hainenber avatar Feb 15 '24 09:02 hainenber

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

tdcmeehan avatar Feb 17 '24 01:02 tdcmeehan

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

hainenber avatar Feb 20 '24 15:02 hainenber

LGTM. Please modify your commit to conform to our standards (linked in the checklist). Perhaps

Add support for Graphviz rendering of delete nodes

tdcmeehan avatar Feb 20 '24 18:02 tdcmeehan

Thanks @tdcmeehan, I've amended the commit message to adhere the guideline

hainenber avatar Feb 21 '24 16:02 hainenber

@hainenber could you look into the test failure?

tdcmeehan avatar Feb 21 '24 21:02 tdcmeehan

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.

yashkrishnan avatar Feb 29 '24 05:02 yashkrishnan