How about creating a RelOptRules#EXTENDED_RULES (or using some existing collection) and provide a means within a Quidem test to turn on that set of rules.
> On Aug 28, 2023, at 9:56 PM, LakeShen <[email protected]> wrote: > > Hi Julian, thanks for you reply.I have got some information from previous > commits, a new rule are added to the RelOptRules#ABSTRACT_RULES collection, > then in RelOptUtil#registerDefaultRules method,It is added to the default > rules,so that we could add the test sql in .iq file and test the > correctness of results for rule. > > I'm not sure whether this is a good way,could we add a standard process to > test the correctness of the results for the optimization rules in calcite? > > Best, > LakeShen > > 在 2023年8月29日 03:26:03 上,Julian Hyde <[email protected]> 写道: > >> The meta-answer: I would use ‘git log’ and identify commit that modify >> both RelOptRulesTest.java and also at least one .iq file. >> >> I don’t think there’s a way to selectively enable a planner rule in a .iq >> file. I don’t know if there is a way to add such a mechanism which is >> reasonably simple for people to understand. >> >> If the rule is added to the standard set of rules then it’s easy to use >> the rule in a Quidem test. I haven’t thought about whether this rule should >> be in the standard rule set. >> >> Julian >> >> >> On Aug 28, 2023, at 5:36 AM, LakeShen <[email protected]> wrote: >> >> >> Hi Community, >> >> >> Now I have created the CALCITE-5889 and have added the >> MinusToDistinctRule,I >> >> want to test the correctness of my optimization rules in quidem,but I >> >> didn't find any unit test that I could refer to. Could the community give >> >> me some help? >> >> >> Usually, we finished the optimization rules, we could add the unit test in >> >> RelOptRulesTest , and then in RelOptRulesTest.xml file, we need add the >> >> expected results of the plan.If we could add end-to-end testing to our >> >> optimization rules, we could ensure that our rules are correct. >> >> >> Best, >> >> LakeShen >> >> >>
