Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3136

Fix the default rule description of ConverterRule.

    XMLWordPrintableJSON

    Details

      Description

      The default rule description of ConvertRule does not obey the description pattern of RelOptRule.

      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();
      }
      
      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();
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                winipanda TANG Wen-hui
                Reporter:
                winipanda TANG Wen-hui
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 10m
                  3h 10m