@Override
  public void deserialize(Block block, int index, MaxOrMinByState state) {
    SliceInput input = block.getSlice(index, 0, block.getLength(index)).getInput();

    int keyLength = input.readInt();
    int valueLength = input.readInt();
    state.setKey(null);
    state.setValue(null);
    if (keyLength > 0) {
      state.setKey(toBlock(keyType, input, keyLength));
    }
    if (valueLength > 0) {
      state.setValue(toBlock(valueType, input, valueLength));
    }
  }
示例#2
0
  @Override
  public Block readBlock(SliceInput sliceInput) {
    int positionCount = sliceInput.readInt();

    boolean[] valueIsNull = decodeNullBits(sliceInput, positionCount);

    long[] values = new long[positionCount];
    for (int position = 0; position < positionCount; position++) {
      if (!valueIsNull[position]) {
        values[position] = sliceInput.readLong();
      }
    }

    return new LongArrayBlock(positionCount, valueIsNull, values);
  }