Steven, James,

>there are 22 implementations of RelShuttleImpl(excluding tests)

14 of them are RelHomogeneousShuttle subclasses.
RelHomogeneousShuttle redirects all customized visit methods into a single
visit(RelNode) method.

That means Calcite has only 6 usages (!) of the "visitor" feature, and the
feature basically forces ALL RelNodes
implement an obscure RelNode#accept.

The method is ill-defined.
Here's its javadoc: "Accepts a visit from a shuttle"
It makes no sense at all. How should I implement this?

@return A copy of this node incorporating changes made by the shuttle to
   * this node's children

None of Calcite's RelNode implementations walk over children or something
when implementing accept(RelShuttle).

----

The only non-test, non-homogeneous subclasses are:

ToLogicalConverter
RelNodesExprsHandler
SqlToRelConverter#convertSelectImpl # "attach hint to the first Hintable
rel"
RelOptMaterialization#tryUseStar
ViewTable#expandView

I do not know if those classes require any of the "visitor" features,
however,
it is clear that the half-visitor is complicating things more often than it
helps.

Vladimir

Reply via email to