[ 
https://issues.apache.org/jira/browse/CALCITE-1166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16759504#comment-16759504
 ] 

Julian Hyde commented on CALCITE-1166:
--------------------------------------

The OperandBuilder approach looks promising.

One slight change: rather than passing the root operand into the RelOptRule 
constructor, pass the builder, and let the RelOptRuleConstructor call 
{{build()}}. It's really useful for operands to be immutable AND know the rule 
instance that they belong to (and their ordinal in the rule).

I don't feel strongly about this, but I don't think you need {{inputs}}. A 
sequence of calls to {{input}} would probably be fine.

> Disallow sub-classes of RelOptRuleOperand
> -----------------------------------------
>
>                 Key: CALCITE-1166
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1166
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.8.0
>
>
> Disallow sub-classes of {{RelOptRuleOperand}}. The only reason that people 
> have sub-classed {{RelOptRuleOperand}} is to override the {{boolean 
> matches(RelNode)}} method, and you can now achieve that by supplying a 
> {{Predicate}} to the constructor.
> Next release, we will deprecate {{RelOptRuleOperand}}'s protected constructor 
> and create a new private or package-protected one. Later we will remove that 
> constructor.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to