Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Extend interface Convention so that a convention can declare which sub-classes of RelNode it uses. The method is as follows:
interface Convention { <R extends RelNode> Pair<Class<? extends R>, RelFactory<R>> getRelClass(Class<R> clazz); } interface RelFactory<R extends RelNode> { RelNode copy(R r); } interface FilterFactory extends RelFactory<Filter> { RelNode createFilter(RelNode input, RexNode condition); }
For example, FooConvention might have classes FooFilter and FooProject.
So, fooConvention.getRelClass(Filter.class) would return a pair, (FooFilter.class, new FooFilterFactory()).
This is a step towards self-describing conventions. A convention could, for example, walk over a tree of logical RelNodes and transcribe them all to its own sub-class of RelNode. And we could have a RelBuilder produce RelNodes to match a particular convention (emulating what is currently done using RelNode.copy).
Attachments
Issue Links
- is related to
-
CALCITE-2970 Performance issue when enabling abstract converter for EnumerableConvention
- Closed