[
https://issues.apache.org/jira/browse/CALCITE-3972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101170#comment-17101170
]
Julian Hyde commented on CALCITE-3972:
--------------------------------------
I don't mind if {{RelBuilder#transform(UnaryOperator<Config> transform)}} - or
a variant of it - preserves the stack. I planned to go in that direction anyway.
I agree that, whatever we decide for the semantics of {{adoptConvention}}, your
example {code} RelNode root =
builder.adoptConvention(EnumerableConvention.INSTANCE)
.scan("EMP")
.filter(
builder.equals(builder.field("DEPTNO"), builder.literal(20)))
.build();{code} should work.
If we're going to make convention part of the mutable state, perhaps a
'push'/'pop' model is better than a 'set' model. Then it's easier to get back
to the previous convention.
> Allow RelBuilder to create RelNode with convention and use it for trait
> convert
> -------------------------------------------------------------------------------
>
> Key: CALCITE-3972
> URL: https://issues.apache.org/jira/browse/CALCITE-3972
> Project: Calcite
> Issue Type: Bug
> Reporter: Xiening Dai
> Assignee: Xiening Dai
> Priority: Major
> Fix For: 1.23.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> 1. Provide Convention.transformRelBuilder() to transform an existing
> RelBuilder into one with specific convention.
> 2. RelBuilder provides withRelFactories() method to allow caller swap the
> underlying RelFactories and create a new builder.
> 3. Use the new interface in RelCollationTraitDef for converting into
> RelCollation traits
> We can avoid ~1/3 of total rule firings in a N way join case with this change.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)