Regarding https://github.com/apache/calcite/pull/1019 
<https://github.com/apache/calcite/pull/1019>.

I can see it might be useful to categorize rules as “converters” (change 
convention, or some other trait, but preserve the same pattern), and 
“single-convention” (all matched rels must have the same convention, and output 
will be of the same convention), and “other”. For rules tagged as 
“single-convention”, we could add some support in the engine to reduce the 
burden on the person writing the rule, and add some extra checks to make sure 
that the rule lives up to its contract.

But I wouldn’t put any of that stuff in RelBuilder or RelBuilderFactory.

Julian


> On Feb 1, 2019, at 10:09 AM, Vladimir Sitnikov <[email protected]> 
> wrote:
> 
> Stamatis > Maybe we could say that if RelOptRule#getOutTrait returns null
> then input traits
> Stamatis >and output traits should always match. It doesn't sound bad to
> allow only a
> Stamatis > Converter to modify traits.
> 
> Unfortunately that does not solve the problem of selecting the proper rules
> to fire.
> We want to select rule before we run it and realize the convention does not
> match.
> 
> In the mean time, https://github.com/apache/calcite/pull/1019 passes all
> the tests in Calcite.
> 
> Note: I've made the approach a bit more generic, so it applies for other
> traits as well, not just Convention.
> 
> Any thoughts?
> 
> Vladimir

Reply via email to