final NullableVarDecimalVector v = ((NullableVarDecimalVector) vector); for (int i = start; i < end; i++) { v.getMutator().setSafe(i, value);
@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 void addNext(int start, int index) { switch (columnChunkMetaData.getType()) { case INT32: valueVec.getMutator().setSafe(index, Ints.toByteArray(bytebuf.getInt(start)), 0, dataTypeLengthInBytes); break; case INT64: valueVec.getMutator().setSafe(index, Longs.toByteArray(bytebuf.getLong(start)), 0, dataTypeLengthInBytes); break; case FIXED_LEN_BYTE_ARRAY: case BINARY: valueVec.getMutator().setSafe(index, 1, start, start + dataTypeLengthInBytes, bytebuf); break; } } }
public void write(VarDecimalHolder h) { mutator.setSafe(idx(), h); vector.getMutator().setValueCount(idx()+1); }
public void writeNull() { mutator.setNull(idx()); vector.getMutator().setValueCount(idx() + 1); }
@Override public boolean setSafe(int index, DrillBuf value, int start, int length) { if (index >= nullableVarDecimalVector.getValueCapacity()) { return false; } if (usingDictionary) { ByteBuffer buf = currDictValToWrite.toByteBuffer(); mutator.setSafe(index, buf, buf.position(), currDictValToWrite.length()); } else { mutator.setSafe(index, 1, start, start + length, value); } return true; }
public void writeVarDecimal(int start, int end, DrillBuf buffer, int scale, int precision) { mutator.setSafe(idx(), 1, start, end, buffer); vector.getMutator().setValueCount(idx() + 1); }
public void write(NullableVarDecimalHolder h) { mutator.setSafe(idx(), h); vector.getMutator().setValueCount(idx()+1); }
private void setValueBytes(int i, byte[] bytes) { valueVec.getMutator().setSafe(valuesReadInCurrentPass + i, bytes, 0, bytes.length); } }
@Override public void allocateNew(int totalBytes, int valueCount) { try { values.allocateNew(totalBytes, valueCount); bits.allocateNew(valueCount); } catch(RuntimeException e) { clear(); throw e; } bits.zeroVector(); mutator.reset(); accessor.reset(); }
public void setSafe(int index, NullableVarDecimalHolder holder) { setType(index, MinorType.VARDECIMAL); getVarDecimalVector().getMutator().setSafe(index, holder); }
public void writeVarDecimal(BigDecimal value) { mutator.setSafe(idx(), value); vector.getMutator().setValueCount(idx() + 1); } }
public void setSafe(int index, NullableVarDecimalHolder value) { if (index > lastSet + 1) { fillEmpties(index); } bits.getMutator().setSafe(index, value.isSet); values.getMutator().setSafe(index, value); setCount++; lastSet = index; }
/** {@inheritDoc} */ @Override protected void setSafe(VarLenBulkInput<VarLenBulkEntry> bulkInput) { mutator.setSafe(bulkInput); }
public void setSafe(int index, int isSet, int startField, int endField, DrillBuf bufferField ) { if (index > lastSet + 1) { fillEmpties(index); } bits.getMutator().setSafe(index, isSet); values.getMutator().setSafe(index, startField, endField, bufferField); setCount++; lastSet = index; }
public void setSafe(int index, ByteBuffer value, int start, int length) { if (index > lastSet + 1) { fillEmpties(index); } bits.getMutator().setSafe(index, 1); values.getMutator().setSafe(index, value, start, length); setCount++; lastSet = index; }
@Override public void reset() { bits.zeroVector(); mutator.reset(); accessor.reset(); super.reset(); }
public void setSafe(int index, BigDecimal value) { if (index > lastSet + 1) { fillEmpties(index); } bits.getMutator().setSafe(index, 1); values.getMutator().setSafe(index, value); setCount++; lastSet = index; }
public void set(int index, BigDecimal value) { if (index > lastSet + 1) { fillEmpties(index); } bits.getMutator().set(index, 1); values.getMutator().set(index, value); setCount++; lastSet = index; }