public enum MapSqlStatisticProvider extends Enum<MapSqlStatisticProvider> implements SqlStatisticProvider
SqlStatisticProvider that looks up values in a
table.
Only for testing.
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isForeignKey(RelOptTable fromTable,
List<Integer> fromColumns,
RelOptTable toTable,
List<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,
List<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(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.
|
public static final MapSqlStatisticProvider INSTANCE
public static MapSqlStatisticProvider[] values()
for (MapSqlStatisticProvider c : MapSqlStatisticProvider.values()) System.out.println(c);
public static MapSqlStatisticProvider valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic double tableCardinality(RelOptTable table)
SqlStatisticProvidertable.tableCardinality in interface SqlStatisticProviderpublic boolean isForeignKey(RelOptTable fromTable, List<Integer> fromColumns, RelOptTable toTable, List<Integer> toColumns)
SqlStatisticProviderFor example, isForeignKey(EMP, [DEPTNO], DEPT, [DEPTNO])
returns true.
To change "at least one" to "exactly one", you also need to call
SqlStatisticProvider.isKey(org.apache.calcite.plan.RelOptTable, java.util.List<java.lang.Integer>).
isForeignKey in interface SqlStatisticProviderpublic boolean isKey(RelOptTable table, List<Integer> columns)
SqlStatisticProviderFor example, isKey(EMP, [DEPTNO] returns true;
For example, isKey(DEPT, [DEPTNO] returns false.
isKey in interface SqlStatisticProviderCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.