feat: add json_tree explain format#5576
Conversation
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
| String logical = RelOptUtil.toString(rel, SqlExplainLevel.NO_ATTRIBUTES); | ||
| listener.onResponse( | ||
| new ExplainResponse(new ExplainResponseNodeV2(logical, null, null))); | ||
| if (format == Format.JSON_TREE) { |
There was a problem hiding this comment.
Core serialization block lives here, the rest is mostly plumbing -- we use calcite's own RelJsonWriter
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
Adds a new machine-readable explain format. Working with the other format is fine for humans but hard to parse and analyze in bulk. This should help simplify some types of testing for e.g. #5505, as well as address #5519, and enable work that lets us see whether specific optimizations are applied over a query set en masse.
Existing explain queries are unaffected, the new format is accessible via
_plugins/_ppl/_explain?format=json_tree.Related Issues
Resolves #5519
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.