public boolean containsPartitionColumnsOnly(ImmutableBitSet cols) { for (int i = cols.nextSetBit(0); i >= 0; i++, i = cols.nextSetBit(i + 1)) { if (!hivePartitionColsMap.containsKey(i)) { return false; } } return true; }
public boolean containsPartitionColumnsOnly(ImmutableBitSet cols) { for (int i = cols.nextSetBit(0); i >= 0; i++, i = cols.nextSetBit(i + 1)) { if (!hivePartitionColsMap.containsKey(i)) { return false; } } return true; }
ExprsItr(ImmutableBitSet fields) { nextMapping = null; columns = new int[fields.cardinality()]; columnSets = new BitSet[fields.cardinality()]; iterationIdx = new int[fields.cardinality()]; for (int j = 0, i = fields.nextSetBit(0); i >= 0; i = fields .nextSetBit(i + 1), j++) { columns[j] = i; columnSets[j] = equivalence.get(i); iterationIdx[j] = 0; } firstCall = true; }
ExprsItr(ImmutableBitSet fields) { nextMapping = null; columns = new int[fields.cardinality()]; columnSets = new BitSet[fields.cardinality()]; iterationIdx = new int[fields.cardinality()]; for (int j = 0, i = fields.nextSetBit(0); i >= 0; i = fields .nextSetBit(i + 1), j++) { columns[j] = i; columnSets[j] = equivalence.get(i); iterationIdx[j] = 0; } firstCall = true; }
private List<RexNode> extractFilterPreds(Filter filterOp) { List<RexNode> conjs = new ArrayList<>(); for (RexNode r : HiveRelOptUtil.conjunctions(filterOp.getCondition())) { if (r.getKind() == SqlKind.IS_NOT_NULL) { RexCall isNotNullNode = (RexCall) r; if (RexUtil.isReferenceOrAccess(isNotNullNode.getOperands().get(0), true)) { ImmutableBitSet ref = RelOptUtil.InputFinder.bits(isNotNullNode); RelColumnOrigin co = mq.getColumnOrigin(filterOp, ref.nextSetBit(0)); if (co == null) { // We add it back conjs.add(r); continue; } RelOptHiveTable table = (RelOptHiveTable) co.getOriginTable(); List<ColStatistics> colStats = table.getColStat(ImmutableList.of(co.getOriginColumnOrdinal()), true); if (colStats == null || colStats.isEmpty() || colStats.get(0).getNumNulls() != 0) { // We add it back conjs.add(r); } } } else { conjs.add(r); } } return conjs; }
void buildGroups() { ColumnRowType inputColumnRowType = ((OLAPRel) getInput()).getColumnRowType(); this.groups = Lists.newArrayList(); for (int i = getGroupSet().nextSetBit(0); i >= 0; i = getGroupSet().nextSetBit(i + 1)) { TupleExpression tupleExpression = inputColumnRowType.getSourceColumnsByIndex(i);
leftColIdx = leftCols.nextSetBit(0) - nSysFields; rightColIdx = rightCols.nextSetBit(0) - (nSysFields + nFieldsLeft);
int leftInput = keysInInputs.nextSetBit(0); int rightInput = keysInInputs.nextSetBit(numberLeftInputs); joinInputs.add(Pair.of(leftInput, rightInput)); joinTypes.add(join.getJoinType());
leftColIdx = leftCols.nextSetBit(0) - nSysFields; rightColIdx = rightCols.nextSetBit(0) - (nSysFields + nFieldsLeft);
int leftInput = keysInInputs.nextSetBit(0); int rightInput = keysInInputs.nextSetBit(numberLeftInputs); joinInputs.add(Pair.of(leftInput, rightInput)); joinTypes.add(join.getJoinType());
rightCols = t; lBitSet.set(leftCols.nextSetBit(0) - nSysFields); rBitSet.set(rightCols.nextSetBit(0) - (nSysFields + nFieldsLeft)); removedOriginalPredicates.add(originalPred);
final int adjustment = inputsRange[i].nextSetBit(0); for (int j = adjustment; j < inputsRange[i].length(); j++) { adjustments[j] = -adjustment;
final int adjustment = inputsRange[i].nextSetBit(0); for (int j = adjustment; j < inputsRange[i].length(); j++) { adjustments[j] = -adjustment;
setIdx = gbKeysDeleted.nextSetBit(setIdx); if(setIdx != -1) { updatedGroupFields = updatedGroupFields.clear(setIdx);
/** Converts this bit set to a list. */ public List<Integer> toList() { final List<Integer> list = new ArrayList<>(); for (int i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { list.add(i); } return list; }
/** Converts this bit set to a list. */ public List<Integer> toList() { final List<Integer> list = new ArrayList<>(); for (int i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { list.add(i); } return list; }
private double rowCountDiff(LoptMultiJoin.Edge edge) { assert edge.factors.cardinality() == 2 : edge.factors; final int factor0 = edge.factors.nextSetBit(0); final int factor1 = edge.factors.nextSetBit(factor0 + 1); return Math.abs(vertexes.get(factor0).cost - vertexes.get(factor1).cost); } };
/** Permutes a bit set according to a given mapping. */ public ImmutableBitSet permute(Map<Integer, Integer> map) { final Builder builder = builder(); for (int i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { builder.set(map.get(i)); } return builder.build(); }
/** Returns a bit set with every bit moved up {@code offset} positions. * Offset may be negative, but throws if any bit ends up negative. */ public ImmutableBitSet shift(int offset) { if (offset == 0) { return this; } final Builder builder = builder(); for (int i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { builder.set(i + offset); } return builder.build(); }
/** Returns a bit set with every bit moved up {@code offset} positions. * Offset may be negative, but throws if any bit ends up negative. */ public ImmutableBitSet shift(int offset) { if (offset == 0) { return this; } final Builder builder = builder(); for (int i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { builder.set(i + offset); } return builder.build(); }