Enum EnumerableConvention

java.lang.Object
java.lang.Enum<EnumerableConvention>
org.apache.calcite.adapter.enumerable.EnumerableConvention
All Implemented Interfaces:
Serializable, Comparable<EnumerableConvention>, Constable, Convention, RelTrait

public enum EnumerableConvention extends Enum<EnumerableConvention> implements Convention
Family of calling conventions that return results as an Enumerable.
  • Enum Constant Details

  • Field Details

    • COST_MULTIPLIER

      public static final double COST_MULTIPLIER
      Cost of an enumerable node versus implementing an equivalent node in a "typical" calling convention.
      See Also:
  • Method Details

    • values

      public static EnumerableConvention[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EnumerableConvention valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Description copied from interface: RelTrait
      Returns a succinct name for this trait. The planner may use this String to describe the trait.
      Specified by:
      toString in interface RelTrait
      Overrides:
      toString in class Enum<EnumerableConvention>
    • getInterface

      public Class getInterface()
      Specified by:
      getInterface in interface Convention
    • getName

      public String getName()
      Specified by:
      getName in interface Convention
    • enforce

      public @Nullable RelNode enforce(RelNode input, RelTraitSet required)
      Description copied from interface: Convention
      Given an input and required traits, returns the corresponding enforcer rel nodes, like physical Sort, Exchange etc.
      Specified by:
      enforce in interface Convention
      Parameters:
      input - The input RelNode
      required - The required traits
      Returns:
      Physical enforcer that satisfies the required traitSet, or null if trait enforcement is not allowed or the required traitSet can't be satisfied.
    • getTraitDef

      public RelTraitDef getTraitDef()
      Description copied from interface: RelTrait
      Returns the RelTraitDef that defines this RelTrait.
      Specified by:
      getTraitDef in interface RelTrait
      Returns:
      the RelTraitDef that defines this RelTrait
    • satisfies

      public boolean satisfies(RelTrait trait)
      Description copied from interface: RelTrait
      Returns whether this trait satisfies a given trait.

      A trait satisfies another if it is the same or stricter. For example, ORDER BY x, y satisfies ORDER BY x.

      A trait's satisfies relation must be a partial order (reflexive, anti-symmetric, transitive). Many traits cannot be "loosened"; their satisfies is an equivalence relation, where only X satisfies X.

      If a trait has multiple values (see RelCompositeTrait) a collection (T0, T1, ...) satisfies T if any Ti satisfies T.

      Specified by:
      satisfies in interface RelTrait
      Parameters:
      trait - Given trait
      Returns:
      Whether this trait subsumes a given trait
    • register

      public void register(RelOptPlanner planner)
      Description copied from interface: RelTrait
      Registers a trait instance with the planner.

      This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.

      Specified by:
      register in interface RelTrait
      Parameters:
      planner - Planner
    • canConvertConvention

      public boolean canConvertConvention(Convention toConvention)
      Description copied from interface: Convention
      Returns whether we should convert from this convention to toConvention. Used by ConventionTraitDef.
      Specified by:
      canConvertConvention in interface Convention
      Parameters:
      toConvention - Desired convention to convert to
      Returns:
      Whether we should convert from this convention to toConvention
    • useAbstractConvertersForConversion

      public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
      Description copied from interface: Convention
      Returns whether we should convert from this trait set to the other trait set.

      The convention decides whether it wants to handle other trait conversions, e.g. collation, distribution, etc. For a given convention, we will only add abstract converters to handle the trait (convention, collation, distribution, etc.) conversions if this function returns true.

      Specified by:
      useAbstractConvertersForConversion in interface Convention
      Parameters:
      fromTraits - Traits of the RelNode that we are converting from
      toTraits - Target traits
      Returns:
      Whether we should add converters
    • getRelFactories

      public RelFactories.Struct getRelFactories()
      Description copied from interface: Convention
      Return RelFactories struct for this convention. It can can be used to build RelNode.
      Specified by:
      getRelFactories in interface Convention