public static void setFromBigIntegerBytesAndScale(byte[] bytes, int offset, int length, HiveDecimalWritable dec) { LazyBinaryUtils.VInt vInt = new LazyBinaryUtils.VInt(); LazyBinaryUtils.readVInt(bytes, offset, vInt); int scale = vInt.value; offset += vInt.length; LazyBinaryUtils.readVInt(bytes, offset, vInt); offset += vInt.length; dec.setFromBigIntegerBytesAndScale(bytes, offset, vInt.value, scale); }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt) { LazyBinaryUtils.readVInt(bytes, offset, vInt); assert (length == vInt.length); set(vInt.value); }
public static int getNanos(byte[] bytes, int offset) { VInt vInt = LazyBinaryUtils.threadLocalVInt.get(); LazyBinaryUtils.readVInt(bytes, offset, vInt); int val = vInt.value; if (val < 0) { // This means there is a second VInt present that specifies additional bits of the timestamp. // The reversed nanoseconds value is still encoded in this VInt. val = -val - 1; } int len = (int) Math.floor(Math.log10(val)) + 1; // Reverse the value int tmp = 0; while (val != 0) { tmp *= 10; tmp += val % 10; val /= 10; } val = tmp; if (len < 9) { val *= Math.pow(10, 9 - len); } return val; }
public static int getNanos(byte[] bytes, int offset) { VInt vInt = LazyBinaryUtils.threadLocalVInt.get(); LazyBinaryUtils.readVInt(bytes, offset, vInt); int val = vInt.value; if (val < 0) { // This means there is a second VInt present that specifies additional bits of the timestamp. // The reversed nanoseconds value is still encoded in this VInt. val = -val - 1; } int len = (int) Math.floor(Math.log10(val)) + 1; // Reverse the value int tmp = 0; while (val != 0) { tmp *= 10; tmp += val % 10; val /= 10; } val = tmp; if (len < 9) { val *= Math.pow(10, 9 - len); } return val; }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt, VLong vLong) { LazyBinaryUtils.readVLong(bytes, offset, vLong); LazyBinaryUtils.readVInt(bytes, offset + vLong.length, vInt); assert (length == (vInt.length + vLong.length)); set(vLong.value, vInt.value); }
@Override public void init(ByteArrayRef bytes, int start, int length) { LazyBinaryUtils.readVInt(bytes.getData(), start, vInt); assert (length == vInt.length); data.set(vInt.value); } }
/** * Initializes LazyBinaryDate object. * @param bytes * @param start * @param length */ @Override public void init(ByteArrayRef bytes, int start, int length) { LazyBinaryUtils.readVInt(bytes.getData(), start, vInt); assert (length == vInt.length); data.set(vInt.value); } }
case MAP: LazyBinaryUtils.readVInt(bytes, offset, tempVInt); if (field.category == Category.LIST) { field.count = tempVInt.value;
LazyBinaryUtils.readVInt(bytes, start, vInt); arraySize = vInt.value; if (0 == arraySize) {
case STRING: LazyBinaryUtils.readVInt(bytes, offset, vInt); recordInfo.elementOffset = vInt.length; recordInfo.elementSize = vInt.value; case CHAR: case VARCHAR: LazyBinaryUtils.readVInt(bytes, offset, vInt); recordInfo.elementOffset = vInt.length; recordInfo.elementSize = vInt.value; case BINARY: LazyBinaryUtils.readVInt(bytes, offset, vInt); recordInfo.elementOffset = vInt.length; recordInfo.elementSize = vInt.value; case DECIMAL: LazyBinaryUtils.readVInt(bytes, offset, vInt); recordInfo.elementOffset = 0; recordInfo.elementSize = vInt.length; LazyBinaryUtils.readVInt(bytes, offset + vInt.length, vInt); recordInfo.elementSize += vInt.length + vInt.value; break;
LazyBinaryUtils.readVInt(bytes, start, vInt); mapSize = vInt.value; if (0 == mapSize) {
throw new EOFException(); LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; currentInt = tempVInt.value; throw new EOFException(); LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; int readScale = tempVInt.value; LazyBinaryUtils.readVInt(bytes, offset, tempVInt); offset += tempVInt.length; int saveStart = offset;
public void setFromBytes(byte[] bytes, int offset, int length) { LazyBinaryUtils.readVInt(bytes, offset, vInt); scale = vInt.value; offset += vInt.length; LazyBinaryUtils.readVInt(bytes, offset, vInt); offset += vInt.length; if (internalStorage.length != vInt.value) { internalStorage = new byte[vInt.value]; } System.arraycopy(bytes, offset, internalStorage, 0, vInt.value); }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt) { LazyBinaryUtils.readVInt(bytes, offset, vInt); assert (length == vInt.length); set(vInt.value); }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt) { LazyBinaryUtils.readVInt(bytes, offset, vInt); assert (length == vInt.length); set(vInt.value); }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt) { LazyBinaryUtils.readVInt(bytes, offset, vInt); assert (length == vInt.length); set(vInt.value); }
public static void setFromBigIntegerBytesAndScale(byte[] bytes, int offset, int length, HiveDecimalWritable dec) { LazyBinaryUtils.VInt vInt = new LazyBinaryUtils.VInt(); LazyBinaryUtils.readVInt(bytes, offset, vInt); int scale = vInt.value; offset += vInt.length; LazyBinaryUtils.readVInt(bytes, offset, vInt); offset += vInt.length; dec.setFromBigIntegerBytesAndScale(bytes, offset, vInt.value, scale); }
@Override public void init(ByteArrayRef bytes, int start, int length) { LazyBinaryUtils.readVInt(bytes.getData(), start, vInt); assert (length == vInt.length); data.set(vInt.value); } }
@Override public void init(ByteArrayRef bytes, int start, int length) { LazyBinaryUtils.readVInt(bytes.getData(), start, vInt); assert (length == vInt.length); data.set(vInt.value); } }
public void setFromBytes(byte[] bytes, int offset, int length, VInt vInt, VLong vLong) { LazyBinaryUtils.readVLong(bytes, offset, vLong); LazyBinaryUtils.readVInt(bytes, offset + vLong.length, vInt); assert (length == (vInt.length + vLong.length)); set(vLong.value, vInt.value); }