本文整理汇总了Java中org.apache.calcite.util.ImmutableBitSet.clear方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableBitSet.clear方法的具体用法?Java ImmutableBitSet.clear怎么用?Java ImmutableBitSet.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.util.ImmutableBitSet
的用法示例。
在下文中一共展示了ImmutableBitSet.clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cardinality
import org.apache.calcite.util.ImmutableBitSet; //导入方法依赖的package包/类
public double cardinality(ImmutableBitSet columnOrdinals) {
final ImmutableBitSet originalOrdinals = columnOrdinals;
for (;;) {
final Distribution distribution = distributionMap.get(columnOrdinals);
if (distribution != null) {
if (columnOrdinals == originalOrdinals) {
return distribution.cardinality;
} else {
final List<Double> cardinalityList = new ArrayList<>();
cardinalityList.add(distribution.cardinality);
for (int ordinal : originalOrdinals.except(columnOrdinals)) {
final Distribution d = singletonDistributionList.get(ordinal);
cardinalityList.add(d.cardinality);
}
return Lattice.getRowCount(rowCount.rowCount, cardinalityList);
}
}
// Clear the last bit and iterate.
// Better would be to combine all of our nearest ancestors.
final List<Integer> list = columnOrdinals.asList();
columnOrdinals = columnOrdinals.clear(Util.last(list));
}
}
示例2: LoptMultiJoin
import org.apache.calcite.util.ImmutableBitSet; //导入方法依赖的package包/类
public LoptMultiJoin(MultiJoin multiJoin) {
this.multiJoin = multiJoin;
joinFactors = ImmutableList.copyOf(multiJoin.getInputs());
nJoinFactors = joinFactors.size();
projFields = multiJoin.getProjFields();
joinFieldRefCountsMap = multiJoin.getCopyJoinFieldRefCountsMap();
joinFilters =
Lists.newArrayList(RelOptUtil.conjunctions(multiJoin.getJoinFilter()));
allJoinFilters = new ArrayList<>(joinFilters);
List<RexNode> outerJoinFilters = multiJoin.getOuterJoinConditions();
for (int i = 0; i < nJoinFactors; i++) {
allJoinFilters.addAll(RelOptUtil.conjunctions(outerJoinFilters.get(i)));
}
int start = 0;
nTotalFields = multiJoin.getRowType().getFieldCount();
joinStart = new int[nJoinFactors];
nFieldsInJoinFactor = new int[nJoinFactors];
for (int i = 0; i < nJoinFactors; i++) {
joinStart[i] = start;
nFieldsInJoinFactor[i] =
joinFactors.get(i).getRowType().getFieldCount();
start += nFieldsInJoinFactor[i];
}
// Extract outer join information from the join factors, including the type
// of outer join and the factors that a null-generating factor is dependent
// upon.
joinTypes = ImmutableList.copyOf(multiJoin.getJoinTypes());
List<RexNode> outerJoinConds = this.multiJoin.getOuterJoinConditions();
outerJoinFactors = new ImmutableBitSet[nJoinFactors];
for (int i = 0; i < nJoinFactors; i++) {
if (outerJoinConds.get(i) != null) {
// set a bitmap containing the factors referenced in the
// ON condition of the outer join; mask off the factor
// corresponding to the factor itself
ImmutableBitSet dependentFactors =
getJoinFilterFactorBitmap(outerJoinConds.get(i), false);
dependentFactors = dependentFactors.clear(i);
outerJoinFactors[i] = dependentFactors;
}
}
// determine which join factors each join filter references
setJoinFilterRefs();
factory = multiJoin.getCluster().getTypeFactory();
joinRemovalFactors = new Integer[nJoinFactors];
joinRemovalSemiJoins = new SemiJoin[nJoinFactors];
removableOuterJoinFactors = new HashSet<>();
removableSelfJoinPairs = new HashMap<>();
}