Ayaka, Per my understanding, HepRelVertex is used to make RelNode changeable easily, you can see more about HepRelVertex#replaceRel, it is used to change one RelNode to another after some rules applied and new equal node produced. In this way, we can easily change subgraphs of the original DAG after performing some RBO rules.
Ayaka Kamisato <cyborgz1...@gmail.com> 于2024年2月19日周一 19:29写道: > > I'm studying Calcite recently and I found that RelNode Tree would be > converted to a DAG composed by HepRelVertex and Edge before the RBO rules > execution, and I don't understand why this step is necessary since RelNode > tree is a DAG essentially. -- Best, Benchao Li