public static float toXorFloat(byte[] value, int offset, int length) { return Float.intBitsToFloat(toXorInt(value, offset, length)); }
/** * Method to type case the data based on modified data type. This method will used for * retrieving the data after change in data type restructure operation * * @param data * @param restructuredDataType * @param currentDataOffset * @param length * @return */ public static long getDataBasedOnRestructuredDataType(byte[] data, DataType restructuredDataType, int currentDataOffset, int length) { long value = 0L; if (restructuredDataType == DataTypes.INT) { value = ByteUtil.toXorInt(data, currentDataOffset, length); } else if (restructuredDataType == DataTypes.LONG) { value = ByteUtil.toXorLong(data, currentDataOffset, length); } return value; }
@Override public void fillVector(byte[] data, CarbonColumnVector vector) { // start position will be used to store the current data position int localOffset = 0; for (int i = 0; i < numberOfRows; i++) { int length = (((data[localOffset] & 0xFF) << 8) | (data[localOffset + 1] & 0xFF)); localOffset += 2; if (length == 0) { vector.putNull(i); } else { vector.putInt(i, ByteUtil.toXorInt(data, localOffset, length)); } localOffset += length; } } }
} else { actualData = this.directDictGenForDate.getValueFromSurrogate( ByteUtil.toXorInt(value, 0, CarbonCommonConstants.INT_SIZE_IN_BYTE));
return null; return ByteUtil.toXorInt(dataInBytes, 0, dataInBytes.length); } else if (actualDataType == DataTypes.LONG) { if (isEmptyByteArray(dataInBytes)) {
vector.putShort(vectorRow, ByteUtil.toXorShort(value, 0, length)); } else if (dt == DataTypes.INT) { vector.putInt(vectorRow, ByteUtil.toXorInt(value, 0, length)); } else if (dt == DataTypes.LONG) { vector.putLong(vectorRow, DataTypeUtil
vector.putShort(vectorRow, ByteUtil.toXorShort(data, currentDataOffset, length)); } else if (dt == DataTypes.INT) { vector.putInt(vectorRow, ByteUtil.toXorInt(data, currentDataOffset, length)); } else if (dt == DataTypes.LONG) { vector.putLong(vectorRow,