You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/07/22 01:41:00 UTC

[jira] [Resolved] (CALCITE-3136) Fix the default rule description of ConverterRule.

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

Danny Chan resolved CALCITE-3136.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.21.0

Fixed in [477937b|https://github.com/apache/calcite/commit/477937b7cd615c0aa7ba1021190c2b3050a6d6e8], thanks for your PR, [~winipanda] !

> 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
>             Fix For: 1.21.0
>
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> 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.14#76016)