[ 
https://issues.apache.org/jira/browse/CALCITE-3136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-3136:
------------------------------------
    Labels: pull-request-available  (was: )

> Fix the default rule description of ConverterRule.
> --------------------------------------------------
>
>                 Key: CALCITE-3136
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3136
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.19.0
>            Reporter: TANG Wen-hui
>            Assignee: TANG Wen-hui
>            Priority: Major
>              Labels: pull-request-available
>
> The default rule description of ConvertRule does not obey the description 
> pattern of RelOptRule.
> {code:java}
> public RelOptRule(RelOptRuleOperand operand,
>     RelBuilderFactory relBuilderFactory, String description) {
>   this.operand = Objects.requireNonNull(operand);
>   this.relBuilderFactory = Objects.requireNonNull(relBuilderFactory);
>   if (description == null) {
>     description = guessDescription(getClass().getName());
>   }
>   if (!description.matches("[A-Za-z][-A-Za-z0-9_.():]*")) {
>     throw new RuntimeException("Rule description '" + description
>         + "' is not valid");
>   }
>   this.description = description;
>   this.operands = flattenOperands(operand);
>   assignSolveOrder();
> }
> {code}
> {code:java}
> public <R extends RelNode> ConverterRule(Class<R> clazz,
>     Predicate<? super R> predicate, RelTrait in, RelTrait out,
>     RelBuilderFactory relBuilderFactory, String description) {
>   super(convertOperand(clazz, predicate, in),
>       relBuilderFactory,
>       description == null
>           ? "ConverterRule<in=" + in + ",out=" + out + ">"
>           : description);
>   this.inTrait = Objects.requireNonNull(in);
>   this.outTrait = Objects.requireNonNull(out);
>   // Source and target traits must have same type
>   assert in.getTraitDef() == out.getTraitDef();
> }
> {code}



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

Reply via email to