Interface RelTrait

    • Method Detail

      • getTraitDef

        RelTraitDef getTraitDef()
        Returns the RelTraitDef that defines this RelTrait.
        Returns:
        the RelTraitDef that defines this RelTrait
      • satisfies

        boolean satisfies​(RelTrait trait)
        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.

        Parameters:
        trait - Given trait
        Returns:
        Whether this trait subsumes a given trait
      • toString

        String toString()
        Returns a succinct name for this trait. The planner may use this String to describe the trait.
        Overrides:
        toString in class Object
      • register

        void register​(RelOptPlanner planner)
        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.

        Parameters:
        planner - Planner
      • apply

        default <T extends RelTrait> T apply​(Mappings.TargetMapping mapping)
        Applies a mapping to this trait.

        Some traits may be changed if the columns order is changed by a mapping of the Project operator.

        For example, if relation SELECT a, b ORDER BY a, b is sorted by columns [0, 1], then the project SELECT b, a over this relation will be sorted by columns [1, 0]. In the same time project SELECT b will not be sorted at all because it doesn't contain the collation prefix and this method will return an empty collation.

        Other traits are independent from the columns remapping. For example Convention or RelDistributions.SINGLETON.

        Parameters:
        mapping - Mapping
        Returns:
        trait with mapping applied
      • isDefault

        default boolean isDefault()
        Returns whether this trait is the default trait value.