Class ConverterRule

    • Field Detail

      • inTrait

        private final RelTrait inTrait
      • outTrait

        private final RelTrait outTrait
    • Constructor Detail

      • ConverterRule

        public ConverterRule​(java.lang.Class<? extends RelNode> clazz,
                             RelTrait in,
                             RelTrait out,
                             java.lang.String description)
        Creates a ConverterRule.
        Parameters:
        clazz - Type of relational expression to consider converting
        in - Trait of relational expression to consider converting
        out - Trait which is converted to
        description - Description of rule
      • ConverterRule

        @Deprecated
        public ConverterRule​(java.lang.Class<R> clazz,
                             com.google.common.base.Predicate<? super R> predicate,
                             RelTrait in,
                             RelTrait out,
                             java.lang.String description)
        Deprecated.
      • ConverterRule

        public ConverterRule​(java.lang.Class<R> clazz,
                             java.util.function.Predicate<? super R> predicate,
                             RelTrait in,
                             RelTrait out,
                             RelBuilderFactory relBuilderFactory,
                             java.lang.String description)
        Creates a ConverterRule with a predicate.
        Parameters:
        clazz - Type of relational expression to consider converting
        predicate - Predicate on the relational expression
        in - Trait of relational expression to consider converting
        out - Trait which is converted to
        relBuilderFactory - Builder for relational expressions
        description - Description of rule
      • ConverterRule

        @Deprecated
        public ConverterRule​(java.lang.Class<R> clazz,
                             com.google.common.base.Predicate<? super R> predicate,
                             RelTrait in,
                             RelTrait out,
                             RelBuilderFactory relBuilderFactory,
                             java.lang.String description)
        Deprecated.
    • Method Detail

      • getOutConvention

        public Convention getOutConvention()
        Description copied from class: RelOptRule
        Returns the convention of the result of firing this rule, null if not known.
        Overrides:
        getOutConvention in class RelOptRule
        Returns:
        Convention of the result of firing this rule, null if not known
      • getOutTrait

        public RelTrait getOutTrait()
        Description copied from class: RelOptRule
        Returns the trait which will be modified as a result of firing this rule, or null if the rule is not a converter rule.
        Overrides:
        getOutTrait in class RelOptRule
        Returns:
        Trait which will be modified as a result of firing this rule, or null if the rule is not a converter rule
      • getInTrait

        public RelTrait getInTrait()
      • convert

        public abstract RelNode convert​(RelNode rel)
        Converts a relational expression to the target trait(s) of this rule.

        Returns null if conversion is not possible.

      • isGuaranteed

        public boolean isGuaranteed()
        Returns true if this rule can convert any relational expression of the input convention.

        The union-to-java converter, for example, is not guaranteed, because it only works on unions.

        Returns:
        true if this rule can convert any relational expression