Class RelCollations

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RelCollations()  
    • Field Detail

      • EMPTY

        public static final RelCollation EMPTY
        A collation indicating that a relation is not sorted. Ordering by no columns.
      • PRESERVE

        @Deprecated
        public static final RelCollation PRESERVE
        Deprecated.
        A collation that cannot be replicated by applying a sort. The only implementation choice is to apply operations that preserve order.
    • Constructor Detail

      • RelCollations

        private RelCollations()
    • Method Detail

      • of

        public static RelCollation of​(int fieldIndex)
        Creates a collation containing one field.
      • createSingleton

        public static java.util.List<RelCollation> createSingleton​(int fieldIndex)
        Creates a list containing one collation containing one field.
      • isValid

        public static boolean isValid​(RelDataType rowType,
                                      java.util.List<RelCollation> collationList,
                                      boolean fail)
        Checks that a collection of collations is valid.
        Parameters:
        rowType - Row type of the relational expression
        collationList - List of collations
        fail - Whether to fail if invalid
        Returns:
        Whether valid
      • equal

        public static boolean equal​(java.util.List<RelCollation> collationList1,
                                    java.util.List<RelCollation> collationList2)
      • ordinals

        public static java.util.List<java.lang.Integer> ordinals​(RelCollation collation)
        Returns the indexes of the field collations in a given collation.
      • ordinals

        public static java.util.List<java.lang.Integer> ordinals​(java.util.List<RelFieldCollation> fieldCollations)
        Returns the indexes of the fields in a list of field collations.
      • contains

        public static boolean contains​(RelCollation collation,
                                       java.lang.Iterable<java.lang.Integer> keys)
        Returns whether a collation indicates that the collection is sorted on a given list of keys.
        Parameters:
        collation - Collation
        keys - List of keys
        Returns:
        Whether the collection is sorted on the given keys
      • contains

        private static boolean contains​(RelCollation collation,
                                        java.util.List<java.lang.Integer> keys)
      • contains

        public static boolean contains​(java.util.List<RelCollation> collations,
                                       ImmutableIntList keys)
        Returns whether one of a list of collations indicates that the collection is sorted on the given list of keys.
      • permute

        public static RelCollation permute​(RelCollation collation,
                                           java.util.Map<java.lang.Integer,​java.lang.Integer> mapping)
        Creates a copy of this collation that changes the ordinals of input fields.