Thanks for surfacing that Stamatis! I recalled that popping up on the list before, but I couldn't find it. I think that could be a really good starting point for what Vladimir is suggesting. I would love to see this be something distributed with Calcite (perhaps the path to a generated graph created in a temp directory could be part of the exception). I like the other suggested outputs Vladimir suggested as well.
Would a good first step be taking Anton's JS and creating the toGraphViz method Vladimir proposed? Personally I think I really like the format of the output he used, but it's worth thinking through some more collectively. -- Michael Mior mm...@apache.org Le lun. 28 janv. 2019 à 07:43, Stamatis Zampetakis <zabe...@gmail.com> a écrit : > > Hi Vladimir, > > Anton Haidai did a nice visualizer [1] for sets, subsets, and rels using > Calcite's logging mechanism. > Maybe it suits your needs. > > Best, > Stamatis > > [1] https://github.com/anha1/apache-calcite-trace-analyzer > > Στις Δευ, 28 Ιαν 2019 στις 1:01 μ.μ., ο/η Vladimir Sitnikov < > sitnikov.vladi...@gmail.com> έγραψε: > > > Hi, > > > > I've been debugging VolcanoPlanner for quite some time recently, and > > it looks like its transparency leaves much to be desired. > > > > Key issues I've run into: > > 1) It is complicated to understand "what happens" during rule execution. > > call.transformTo(..) is used a lot, and it is really hard to keep in > > head the IDs of rels, subsets, etc > > 2) It takes time to draw the rels on a paper > > 3) "CannotPlanException" is not human readable. I can read it now, > > however it really takes time to navigate through IDs. > > > > I think a visual representation of the planner state would help a lot > > for both debugging and/or crash analysis. > > Does anyone have a tool to visualize sets, subsets, rels and friends? > > > > For instance: > > A) Add String VolcanoPlanner#toGraphViz() so a dump of the current > > planner state can be obtained and printed (e.g. during debug) > > B) Implement automatic dump of "before and after" images for each rule > > execution. In other words, display a source state, highlight rule > > operands there, and display the final state. Bonus point for an > > animated gif :) > > C) Add a GraphViz-compatible bit to CannotPlanException, so the state > > can be visualized. > > D) Highlight possible root cause in CannotPlanException output. For > > instance, empty subset is a strong indicator. In case it can be > > related to original plan (or even SQL), then it would be great to have > > that pointer as well. > > > > > > Vladimir > >