@Override public int getValueCapacity() { return vector.getValueCapacity(); }
@Override public boolean setSafe(int index, ArrowBuf bytebuf, int start, int length) { /* data read from Parquet into the bytebuf is already in BE format, no need * swap bytes to construct BigDecimal. only when we write BigDecimal to * data buffer of decimal vector, we need to swap bytes which the DecimalUtility * function already does. */ BigDecimal intermediate = DecimalHelper.getBigDecimalFromBEArrowBuf(bytebuf, index, schemaElement.getScale()); if (index >= decimalVector.getValueCapacity()) { return false; } /* this will swap bytes as we are writing to the buffer of DecimalVector */ DecimalUtility.writeBigDecimalToArrowBuf(intermediate, decimalVector.getDataBuffer(), index); decimalVector.setIndexDefined(index); return true; }
@Override public boolean setSafe(int index, ArrowBuf bytebuf, int start, int length) { /* data read from Parquet into the bytebuf is already in BE format, no need * swap bytes to construct BigDecimal. only when we write BigDecimal to * data buffer of decimal vector, we need to swap bytes which the DecimalUtility * function already does. */ BigDecimal intermediate = DecimalHelper.getBigDecimalFromBEArrowBuf(bytebuf, index, schemaElement.getScale()); if (index >= decimalVector.getValueCapacity()) { return false; } /* this will swap bytes as we are writing to the buffer of DecimalVector */ DecimalUtility.writeBigDecimalToArrowBuf(intermediate, decimalVector.getDataBuffer(), index); decimalVector.setIndexDefined(index); return true; }