if (pci.kuduColumn.isNullable()) { ((NullableBitVector.Mutator) pci.vv.getMutator()) .setSafe(rowIndex, result.getBoolean(pci.index) ? 1 : 0); } else { ((BitVector.Mutator) pci.vv.getMutator())
Boolean value = (Boolean) val; for (int i = start; i < end; i++) { v.getMutator().set(i, value ? 1 : 0);
@Override public boolean allocateNewSafe() { /* Boolean to keep track if all the memory allocations were successful * Used in the case of composite vectors when we need to allocate multiple * buffers for multiple vectors. If one of the allocations failed we need to * clear all the memory that we allocated */ boolean success = false; try { success = values.allocateNewSafe() && bits.allocateNewSafe(); } finally { if (!success) { clear(); } } bits.zeroVector(); mutator.reset(); accessor.reset(); return success; }
@Override public void readField(long recordsToReadInThisPass) { recordsReadInThisIteration = Math.min(pageReader.currentPageCount - pageReader.valuesRead, recordsToReadInThisPass - valuesReadInCurrentPass); int defLevel; for (int i = 0; i < recordsReadInThisIteration; i++){ defLevel = pageReader.definitionLevels.readInteger(); // if the value is defined if (defLevel == columnDescriptor.getMaxDefinitionLevel()){ valueVec.getMutator().setSafe(i + valuesReadInCurrentPass, pageReader.valueReader.readBoolean() ? 1 : 0 ); } // otherwise the value is skipped, because the bit vector indicating nullability is zero filled } }
public void write(NullableBitHolder h) { mutator.setSafe(idx(), h); vector.getMutator().setValueCount(idx()+1); }
public void setSafe(int index, NullableBitHolder holder) { setType(index, MinorType.BIT); getBitVector().getMutator().setSafe(index, holder); }
public void writeBit(int value) { mutator.setSafe(idx(), 1, value); vector.getMutator().setValueCount(idx() + 1); }
public void write(BitHolder h) { mutator.setSafe(idx(), h); vector.getMutator().setValueCount(idx()+1); }
public void writeNull() { mutator.setNull(idx()); vector.getMutator().setValueCount(idx() + 1); }
@Override public void allocateNew(int valueCount) { try { values.allocateNew(valueCount); bits.allocateNew(valueCount); } catch(OutOfMemoryException e) { clear(); throw e; } bits.zeroVector(); mutator.reset(); accessor.reset(); }
public void copyFrom(int fromIndex, int thisIndex, NullableBitVector from){ final Accessor fromAccessor = from.getAccessor(); if (!fromAccessor.isNull(fromIndex)) { mutator.set(thisIndex, fromAccessor.get(fromIndex)); } }
@Override public void reset() { bits.zeroVector(); mutator.reset(); accessor.reset(); super.reset(); }
@Override public void exchange(ValueVector other) { NullableBitVector target = (NullableBitVector) other; bits.exchange(target.bits); values.exchange(target.values); mutator.exchange(other.getMutator()); }
@Override public void toNullable(ValueVector nullableVector) { NullableBitVector dest = (NullableBitVector) nullableVector; dest.getMutator().fromNotNullable(this); } }
@Override public void writeField(Object value, int outboundIndex) { if (value != null) { vector.getMutator().setSafe(outboundIndex, (Boolean) value ? 1 : 0); } }
@Override public boolean allocateNewSafe() { /* Boolean to keep track if all the memory allocations were successful * Used in the case of composite vectors when we need to allocate multiple * buffers for multiple vectors. If one of the allocations failed we need to * clear all the memory that we allocated */ boolean success = false; try { success = values.allocateNewSafe() && bits.allocateNewSafe(); } finally { if (!success) { clear(); } } bits.zeroVector(); mutator.reset(); accessor.reset(); return success; }
public void writeNull() { mutator.setNull(idx()); vector.getMutator().setValueCount(idx() + 1); }
public void setSafe(int index, NullableBitHolder holder) { setType(index, MinorType.BIT); getBitVector().getMutator().setSafe(index, holder); }