@Override public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException { this.in = in; if (fixedWidth) { // initialize for repetition and definition levels if (readLength) { int length = readIntLittleEndian(); this.in = in.sliceStream(length); } } else { // initialize for values if (in.available() > 0) { init(in.read()); } } if (bitWidth == 0) { // 0 bit width, treat this as an RLE run of valueCount number of 0's. this.mode = MODE.RLE; this.currentCount = valueCount; this.currentValue = 0; } else { this.currentCount = 0; } }
@Override public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException { this.in = in; if (fixedWidth) { // initialize for repetition and definition levels if (readLength) { int length = readIntLittleEndian(); this.in = in.sliceStream(length); } } else { // initialize for values if (in.available() > 0) { init(in.read()); } } if (bitWidth == 0) { // 0 bit width, treat this as an RLE run of valueCount number of 0's. this.mode = MODE.RLE; this.currentCount = valueCount; this.currentValue = 0; } else { this.currentCount = 0; } }
/** * {@inheritDoc} * @see org.apache.parquet.column.values.ValuesReader#initFromPage(int, ByteBufferInputStream) */ @Override public void initFromPage(int valueCount, ByteBufferInputStream stream) throws IOException { int effectiveBitLength = valueCount * bitsPerValue; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); LOG.debug("reading {} bytes for {} values of size {} bits.", length, valueCount, bitsPerValue); this.in = stream.sliceStream(length); this.bitPackingReader = createBitPackingReader(bitsPerValue, this.in, valueCount); }
@Override public void initFromPage(int valueCount, ByteBufferInputStream stream) throws IOException { int effectiveBitLength = valueCount * bitWidth; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); // ceil LOG.debug("reading {} bytes for {} values of size {} bits.", length, valueCount, bitWidth); // work-around for null values. this will not happen for repetition or // definition levels (never null), but will happen when valueCount has not // been adjusted for null values in the data. length = Math.min(length, stream.available()); this.in = stream.sliceStream(length); this.decodedPosition = VALUES_AT_A_TIME - 1; }
@Override public void initFromPage(int valueCountL, ByteBufferInputStream stream) throws IOException { int length = BytesUtils.readIntLittleEndian(stream); this.decoder = new RunLengthBitPackingHybridDecoder( bitWidth, stream.sliceStream(length)); }
@Override public void initFromPage(int valueCount, ByteBufferInputStream stream) throws IOException { int effectiveBitLength = valueCount * bitWidth; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); // ceil LOG.debug("reading {} bytes for {} values of size {} bits.", length, valueCount, bitWidth); // work-around for null values. this will not happen for repetition or // definition levels (never null), but will happen when valueCount has not // been adjusted for null values in the data. length = Math.min(length, stream.available()); this.in = stream.sliceStream(length); this.decodedPosition = VALUES_AT_A_TIME - 1; updateNextOffset(length); }
/** * {@inheritDoc} * @see org.apache.parquet.column.values.ValuesReader#initFromPage(int, ByteBufferInputStream) */ @Override public void initFromPage(int valueCount, ByteBufferInputStream stream) throws IOException { int effectiveBitLength = valueCount * bitsPerValue; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); LOG.debug("reading {} bytes for {} values of size {} bits.", length, valueCount, bitsPerValue); this.in = stream.sliceStream(length); this.bitPackingReader = createBitPackingReader(bitsPerValue, this.in, valueCount); updateNextOffset(length); }
@Override public void initFromPage(int valueCountL, ByteBufferInputStream stream) throws IOException { int length = BytesUtils.readIntLittleEndian(stream); this.decoder = new RunLengthBitPackingHybridDecoder( bitWidth, stream.sliceStream(length)); // 4 is for the length which is stored as 4 bytes little endian updateNextOffset(length + 4); }