@Override public Statistic getStatistic() { return tbl.getStatistic(); }
@Override public Statistic getStatistic() { return tbl.getStatistic(); }
public List<RelReferentialConstraint> getReferentialConstraints() { if (table != null) { return table.getStatistic().getReferentialConstraints(); } return ImmutableList.of(); }
public double getRowCount() { if (rowCount != null) { return rowCount; } if (table != null) { final Double rowCount = table.getStatistic().getRowCount(); if (rowCount != null) { return rowCount; } } return 100d; }
public List<RelReferentialConstraint> getReferentialConstraints() { if (table != null) { return table.getStatistic().getReferentialConstraints(); } return ImmutableList.of(); }
public List<RelCollation> getCollationList() { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); }
public boolean isKey(ImmutableBitSet columns) { if (table != null) { return table.getStatistic().isKey(columns); } return false; }
public boolean isKey(ImmutableBitSet columns) { if (table != null) { return table.getStatistic().isKey(columns); } return false; }
public double getRowCount() { if (rowCount != null) { return rowCount; } if (table != null) { final Double rowCount = table.getStatistic().getRowCount(); if (rowCount != null) { return rowCount; } } return 100d; }
public List<RelCollation> getCollationList() { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); }
public RelDistribution getDistribution() { if (table != null) { return table.getStatistic().getDistribution(); } return RelDistributionTraitDef.INSTANCE.getDefault(); }
public RelDistribution getDistribution() { if (table != null) { return table.getStatistic().getDistribution(); } return RelDistributionTraitDef.INSTANCE.getDefault(); }
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, Table table, List<String> names, Expression expression) { final Function<Class, Expression> expressionFunction = (Function) Functions.constant(expression); return new RelOptTableImpl(schema, rowType, names, table, expressionFunction, table.getStatistic().getRowCount()); }
public SqlMonotonicity getMonotonicity(String columnName) { final int i = rowType.getFieldNames().indexOf(columnName); if (i >= 0) { for (RelCollation collation : table.getStatistic().getCollations()) { final RelFieldCollation fieldCollation = collation.getFieldCollations().get(0); if (fieldCollation.getFieldIndex() == i) { return fieldCollation.direction.monotonicity(); } } } return SqlMonotonicity.NOT_MONOTONIC; }
public SqlMonotonicity getMonotonicity(String columnName) { final int i = rowType.getFieldNames().indexOf(columnName); if (i >= 0) { for (RelCollation collation : table.getStatistic().getCollations()) { final RelFieldCollation fieldCollation = collation.getFieldCollations().get(0); if (fieldCollation.getFieldIndex() == i) { return fieldCollation.direction.monotonicity(); } } } return SqlMonotonicity.NOT_MONOTONIC; }
/** Creates an EnumerableTableScan. */ public static EnumerableTableScan create(RelOptCluster cluster, RelOptTable relOptTable) { final Table table = relOptTable.unwrap(Table.class); Class elementType = EnumerableTableScan.deduceElementType(table); final RelTraitSet traitSet = cluster.traitSetOf(EnumerableConvention.INSTANCE) .replaceIfs(RelCollationTraitDef.INSTANCE, () -> { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); }); return new EnumerableTableScan(cluster, traitSet, relOptTable, elementType); }
/** Creates an EnumerableTableScan. */ public static EnumerableTableScan create(RelOptCluster cluster, RelOptTable relOptTable) { final Table table = relOptTable.unwrap(Table.class); Class elementType = EnumerableTableScan.deduceElementType(table); final RelTraitSet traitSet = cluster.traitSetOf(EnumerableConvention.INSTANCE) .replaceIfs(RelCollationTraitDef.INSTANCE, () -> { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); }); return new EnumerableTableScan(cluster, traitSet, relOptTable, elementType); }
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, Table table, Path path) { final SchemaPlus schemaPlus = MySchemaPlus.create(path); return new RelOptTableImpl(schema, rowType, Pair.left(path), table, getClassExpressionFunction(schemaPlus, Util.last(path).left, table), table.getStatistic().getRowCount()); }
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, Table table, Path path) { final SchemaPlus schemaPlus = MySchemaPlus.create(path); return new RelOptTableImpl(schema, rowType, Pair.left(path), table, getClassExpressionFunction(schemaPlus, Util.last(path).left, table), table.getStatistic().getRowCount()); }
/** Creates an DirPrunedEnumerableTableScan. */ public static EnumerableTableScan create(RelOptCluster cluster, RelOptTable relOptTable, String digestFromSelection) { final Table table = relOptTable.unwrap(Table.class); Class elementType = EnumerableTableScan.deduceElementType(table); final RelTraitSet traitSet = cluster.traitSetOf(EnumerableConvention.INSTANCE) .replaceIfs(RelCollationTraitDef.INSTANCE, () -> { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); }); return new DirPrunedEnumerableTableScan(cluster, traitSet, relOptTable, elementType, digestFromSelection); }