private void writeMap(ListVector arrowVector, MapColumnVector hiveVector, MapTypeInfo typeInfo, int size, VectorizedRowBatch vectorizedRowBatch, boolean isNative) { final ListTypeInfo structListTypeInfo = toStructListTypeInfo(typeInfo); final ListColumnVector structListVector = toStructListVector(hiveVector); write(arrowVector, structListVector, structListTypeInfo, size, vectorizedRowBatch, isNative); final ArrowBuf validityBuffer = arrowVector.getValidityBuffer(); for (int rowIndex = 0; rowIndex < size; rowIndex++) { if (hiveVector.isNull[rowIndex]) { BitVectorHelper.setValidityBit(validityBuffer, rowIndex, 0); } else { BitVectorHelper.setValidityBitToOne(validityBuffer, rowIndex); } } }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
private void writeStruct(NonNullableStructVector arrowVector, StructColumnVector hiveVector, StructTypeInfo typeInfo, int size, VectorizedRowBatch vectorizedRowBatch, boolean isNative) { final List<String> fieldNames = typeInfo.getAllStructFieldNames(); final List<TypeInfo> fieldTypeInfos = typeInfo.getAllStructFieldTypeInfos(); final ColumnVector[] hiveFieldVectors = hiveVector.fields; final int fieldSize = fieldTypeInfos.size(); for (int fieldIndex = 0; fieldIndex < fieldSize; fieldIndex++) { final TypeInfo fieldTypeInfo = fieldTypeInfos.get(fieldIndex); final ColumnVector hiveFieldVector = hiveFieldVectors[fieldIndex]; final String fieldName = fieldNames.get(fieldIndex); final FieldVector arrowFieldVector = arrowVector.addOrGet(fieldName, toFieldType(fieldTypeInfos.get(fieldIndex)), FieldVector.class); arrowFieldVector.setInitialCapacity(size); arrowFieldVector.allocateNew(); write(arrowFieldVector, hiveFieldVector, fieldTypeInfo, size, vectorizedRowBatch, isNative); } final ArrowBuf validityBuffer = arrowVector.getValidityBuffer(); for (int rowIndex = 0; rowIndex < size; rowIndex++) { if (hiveVector.isNull[rowIndex]) { BitVectorHelper.setValidityBit(validityBuffer, rowIndex, 0); } else { BitVectorHelper.setValidityBitToOne(validityBuffer, rowIndex); } } }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
public void set(int index, int isSet, byte value) { if (isSet > 0) { set(index, value); } else { BitVectorHelper.setValidityBit(validityBuffer, index, 0); } }
public void set(int index, int isSet, byte[] value) { if (isSet > 0) { set(index, value); } else { BitVectorHelper.setValidityBit(validityBuffer, index, 0); } }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
/** * Set the element at the given index to null. * * @param index position of element */ public void setNull(int index) { handleSafe(index); // not really needed to set the bit to 0 as long as // the buffer always starts from 0. BitVectorHelper.setValidityBit(validityBuffer, index, 0); }
@Override public void copyValueSafe(int fromIndex, int toIndex) { while (toIndex >= target.getValidityBufferValueCapacity()) { target.reallocValidityBuffer(); } BitVectorHelper.setValidityBit(target.validityBuffer, toIndex, isSet(fromIndex)); super.copyValueSafe(fromIndex, toIndex); }
public void copyFrom(int fromIndex, int thisIndex, UInt2Vector from) { BitVectorHelper.setValidityBit(validityBuffer, thisIndex, from.isSet(fromIndex)); final char value = from.valueBuffer.getChar(fromIndex * TYPE_WIDTH); valueBuffer.setChar(thisIndex * TYPE_WIDTH, value); }
public void copyFrom(int fromIndex, int thisIndex, UInt4Vector from) { BitVectorHelper.setValidityBit(validityBuffer, thisIndex, from.isSet(fromIndex)); final int value = from.valueBuffer.getInt(fromIndex * TYPE_WIDTH); valueBuffer.setInt(thisIndex * TYPE_WIDTH, value); }