Hi everybody, First of all, thank you for answers and suggestions. Let me address them briefly: 1) I use two conventions at the moment, LOGICAL and PHYSICAL. I agree with you that this might be overkill, and there is a chance that in the final solution we may end up with only one. But meanwhile having this separation seems handy, because on the first stage I enforce the optimizer to propagate NONE -> LOGICAL conversions. Then I have a clean logical tree *before* any physical distribution stuff is involved, which I can use for internal post-processing before going logical. I would propose to keep it out of scope at the moment. Let's just consider that the goal is to convert from one convention to another. 2) Operands with "any" matchers are already used 3) The reason why I would like to avoid the "Project" rule fire on the first run, is that it doesn't enforce any distribution on its child ("Scan"). Instead, it needs to derive the distribution from the scan.
To make the problem more clear, let me prepare a simple reproducer for the issue. Regards, Vladimir. вт, 29 окт. 2019 г. в 10:01, Seliverstov Igor <gvvinbl...@gmail.com>: > Vladimir, > > I guess Project rule doesn't have a child matcher. Put into it child "any" > match rule and it will apply on each child node transformation. > > Regards, > Igor > > > вт, 29 окт. 2019 г., 7:07 Danny Chan <yuzhao....@gmail.com>: > > > Vladimir, all you need to do is to change the convention of the root > node, > > the volcano would propagate the convention to all its input nodes when > > registering them to the planner. You can take this code [1] for > reference :) > > > > [1] > > > https://github.com/apache/calcite/blob/1ef2821695ca6e10fbad7b8efe7246c4a20143af/core/src/main/java/org/apache/calcite/tools/Programs.java#L324 > > > > Best, > > Danny Chan > > 在 2019年10月29日 +0800 AM5:24,dev@calcite.apache.org,写道: > > > > > > n of the scan. > > >