Enum MapSqlStatisticProvider

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      INSTANCE  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.Double> cardinalityMap  
      private com.google.common.collect.ImmutableMultimap<java.lang.String,​java.util.List<java.lang.String>> keyMap  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.util.List<java.lang.String> columnNames​(RelOptTable table, java.util.List<java.lang.Integer> columns)  
      boolean isForeignKey​(RelOptTable fromTable, java.util.List<java.lang.Integer> fromColumns, RelOptTable toTable, java.util.List<java.lang.Integer> toColumns)
      Returns whether a join is a foreign key; that is, whether every row in the referencing table is matched by at least one row in the referenced table.
      boolean isKey​(RelOptTable table, java.util.List<java.lang.Integer> columns)
      Returns whether a collection of columns is a unique (or primary) key.
      double tableCardinality​(RelOptTable table)
      Returns an estimate of the number of rows in table.
      static MapSqlStatisticProvider valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MapSqlStatisticProvider[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • cardinalityMap

        private final java.util.Map<java.lang.String,​java.lang.Double> cardinalityMap
      • keyMap

        private final com.google.common.collect.ImmutableMultimap<java.lang.String,​java.util.List<java.lang.String>> keyMap
    • Constructor Detail

      • MapSqlStatisticProvider

        private MapSqlStatisticProvider()
    • Method Detail

      • values

        public static MapSqlStatisticProvider[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MapSqlStatisticProvider c : MapSqlStatisticProvider.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MapSqlStatisticProvider valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isKey

        public boolean isKey​(RelOptTable table,
                             java.util.List<java.lang.Integer> columns)
        Description copied from interface: SqlStatisticProvider
        Returns whether a collection of columns is a unique (or primary) key.

        For example, isKey(EMP, [DEPTNO] returns true;

        For example, isKey(DEPT, [DEPTNO] returns false.

        Specified by:
        isKey in interface SqlStatisticProvider
      • columnNames

        private java.util.List<java.lang.String> columnNames​(RelOptTable table,
                                                             java.util.List<java.lang.Integer> columns)