Are you familiar with RelOptRulesTest? It compares the RelNode tree before and 
after applying a particular rule or set of rules. You can apply rules 
beforehand to get the tree into exactly the desired state, so you can see the 
effect of the rule(s) you want to test. The before and after strings are held 
in an XML file so it’s easy to update the output if necessary.

> On Feb 8, 2018, at 9:51 AM, Timothy Farkas <[email protected]> wrote:
> 
> Hi All,
> 
> I've recently been working on Drill ticket to make sure Drill's planner 
> (calcite) does not assume the HashJoin operator preserves ordering by 
> removing the Collation trait. I'm at the point where I want to write a 
> decisive unit test for my change. Currently Drill tests the output of it's 
> planner by producing an explain string for a query and matching regexes 
> against it to see if the output looks kind of right. I'm not particularly 
> confident in this approach and was wondering if you guys have a better way to 
> test planner outputs and the effects of traits like the Collation trait?
> 
> Thanks,
> Tim

Reply via email to