Java源码示例:org.apache.calcite.schema.Statistic
示例1
@NotNull
private Statistic createStatistic(Statistic parentStatistic) {
return new Statistic() {
@Override
public Double getRowCount() {
return StatisticCenter.INSTANCE.getPhysicsTableRow(backendTableInfo.getSchema(),
backendTableInfo.getTable(),
backendTableInfo.getTargetName());
}
@Override
public boolean isKey(ImmutableBitSet columns) {
return parentStatistic.isKey(columns);
}
@Override
public List<ImmutableBitSet> getKeys() {
return parentStatistic.getKeys();
}
@Override
public List<RelReferentialConstraint> getReferentialConstraints() {
return parentStatistic.getReferentialConstraints();
}
@Override
public List<RelCollation> getCollations() {
return parentStatistic.getCollations();
}
@Override
public RelDistribution getDistribution() {
return parentStatistic.getDistribution();
}
};
}
示例2
@Override
public Statistic getStatistic() {
if (statistic == null) {
Statistic parentStatistic = logicTable.getStatistic();
statistic = createStatistic(parentStatistic);
}
return this.statistic;
}
示例3
private Statistic createStatistic(ImmutableList<ImmutableBitSet> immutableBitSets) {
return new Statistic() {
public Double getRowCount() {
return StatisticCenter.INSTANCE.getLogicTableRow(table.getSchemaName(),table.getTableName());
}
public boolean isKey(ImmutableBitSet columns) {
return immutableBitSets.contains(columns);
}
public List<ImmutableBitSet> getKeys() {
return immutableBitSets;
}
public List<RelReferentialConstraint> getReferentialConstraints() {
return ImmutableList.of();
}
public List<RelCollation> getCollations() {
return ImmutableList.of();
}
public RelDistribution getDistribution() {
return RelDistributionTraitDef.INSTANCE.getDefault();
}
};
}
示例4
@Override
public Statistic getStatistic() {
return new StatisticImpl() {
@Override
public Double getRowCount() {
return (double) dataset.getReadDefinition().getScanStats().getRecordCount();
}
@Override
public List<RelReferentialConstraint> getReferentialConstraints() {
return ImmutableList.of();
}
};
}
示例5
@Override
public Statistic getStatistic() {
return new StatisticImpl() {
@Override
public Double getRowCount() {
return (double) datasetConfig.get().getReadDefinition().getScanStats().getRecordCount();
}
@Override
public List<RelReferentialConstraint> getReferentialConstraints() {
return ImmutableList.of();
}
};
}
示例6
private Statistic buildStatistic() {
if (stats != null || primaryKey == -1) {
return stats;
}
Direction dir = primaryKeyMonotonicity == INCREASING ? ASCENDING : DESCENDING;
RelFieldCollation collation = new RelFieldCollation(primaryKey, dir, NullDirection.UNSPECIFIED);
return Statistics.of(fields.size(), ImmutableList.of(ImmutableBitSet.of(primaryKey)),
ImmutableList.of(RelCollations.of(collation)));
}
示例7
@Override
public Statistic getStatistic() {
int counter = 0;
for (IThreadStack threadStack : getThreadStacks()) {
counter += threadStack.getStackFrames().length;
}
return Statistics.of(counter, ImmutableList.of(ImmutableBitSet.of(0, 1)));
}
示例8
public Statistic getStatistic() {
final List<ImmutableBitSet> keys = new ArrayList<>();
final Content content = supplier.get();
for (Ord<Column> ord : Ord.zip(content.columns)) {
if (ord.e.cardinality == content.size) {
keys.add(ImmutableBitSet.of(ord.i));
}
}
return Statistics.of(content.size, keys, content.collations);
}
示例9
public Statistic getStatistic() {
return new Statistic() {
public Double getRowCount() {
return table.rowCount;
}
public boolean isKey(ImmutableBitSet columns) {
return table.isKey(columns);
}
public List<ImmutableBitSet> getKeys() {
return table.getKeys();
}
public List<RelReferentialConstraint> getReferentialConstraints() {
return table.getReferentialConstraints();
}
public List<RelCollation> getCollations() {
return table.collationList;
}
public RelDistribution getDistribution() {
return table.getDistribution();
}
};
}
示例10
@Override public Statistic getStatistic() {
List<RelFieldCollation> collationFields = new ArrayList<>();
for (Integer key : pkColumns) {
collationFields.add(
new RelFieldCollation(
key,
RelFieldCollation.Direction.ASCENDING,
RelFieldCollation.NullDirection.LAST));
}
return Statistics.of(data.size(), ImmutableList.of(pkColumns),
ImmutableList.of(RelCollations.of(collationFields)));
}
示例11
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例12
@Override
public Statistic getStatistic() {
return drillTable.getStatistic();
}
示例13
@Override
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例14
@Override
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例15
@Override
public Statistic getStatistic() {
List<ImmutableBitSet> keys = new ArrayList<ImmutableBitSet>();
return Statistics.of(100, keys);
}
示例16
@Override
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例17
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例18
FieldTable(Field field, Type elementType, Supplier< Enumerable> enumerable,
Statistic statistic) {
super(elementType, enumerable);
this.field = field;
this.statistic = statistic;
}
示例19
@Override public Statistic getStatistic() {
return statistic;
}
示例20
@Override
public Statistic getStatistic() {
return statistic;
}
示例21
@Override
public Statistic getStatistic() {
return Statistics.UNKNOWN;
}
示例22
@Override
public Statistic getStatistic() {
return Statistics.of(tableManager.getStats().getTablesize(),
keys);
}
示例23
@Override
public Statistic getStatistic()
{
return Statistics.of(100d, ImmutableList.<ImmutableBitSet>of(), RelCollations.createSingleton(0));
}
示例24
public TableBuilderInfo statistics(Statistic stats) {
this.stats = stats;
return this;
}
示例25
public Statistic getStatistic() {
return Statistics.of(0d, ImmutableList.<ImmutableBitSet>of());
}
示例26
public Statistic getStatistic() {
return Statistics.of(0d, ImmutableList.<ImmutableBitSet>of());
}
示例27
@Override
public Statistic getStatistic() {
List<ImmutableBitSet> keys = new ArrayList<ImmutableBitSet>();
return Statistics.of(100, keys);
}
示例28
@Override
public Statistic getStatistic() {
return Statistics.of(values.size(), unique ? UNIQUE_KEYS_STATISTICS : NON_UNIQUE_KEYS_STATISTICS);
}
示例29
@Override
public Statistic getStatistic() {
List<ImmutableBitSet> uniqueKeys = ImmutableList.of(ImmutableBitSet.of(0));
return Statistics.of(classesList.getTotalObjects(), uniqueKeys);
}
示例30
@Override
public Statistic getStatistic() {
List<ImmutableBitSet> uniqueKeys = ImmutableList.of(ImmutableBitSet.of(0));
return Statistics.of(classesList.getTotalObjects(), uniqueKeys);
}