/** * Get short int value at rowId */ @Override public int getShortInt(int rowId) { return ByteUtil.valueOf3Bytes(shortIntData, rowId * 3); }
@Override public int getShortInt(int rowId) { return ByteUtil.valueOf3Bytes(shortIntData, rowId * 3); }
@Override public int getShortInt(int rowId) { long offset = rowId * 3L; byte[] data = new byte[3]; data[0] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset); data[1] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset + 1); data[2] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset + 2); return ByteUtil.valueOf3Bytes(data, 0); }
@Override public int getShortInt(int rowId) { long offset = rowId * 3L; byte[] data = new byte[3]; data[0] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset); data[1] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset + 1); data[2] = CarbonUnsafe.getUnsafe().getByte(baseAddress, baseOffset + offset + 2); return ByteUtil.valueOf3Bytes(data, 0); }
} else { BigDecimal value = BigDecimal .valueOf(ByteUtil.valueOf3Bytes(data, i * DataTypes.SHORT_INT.getSizeInBytes()), scale); if (value.scale() < newMeasureScale) {
int size = pageSize * DataTypes.SHORT_INT.getSizeInBytes(); for (int i = 0; i < size; i += DataTypes.SHORT_INT.getSizeInBytes()) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putFloat(rowId++, (max - shortInt) / floatFactor); int size = pageSize * DataTypes.SHORT_INT.getSizeInBytes(); for (int i = 0; i < size; i += DataTypes.SHORT_INT.getSizeInBytes()) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putDouble(rowId++, (max - shortInt) / factor);
int size = pageSize * DataTypes.SHORT_INT.getSizeInBytes(); for (int i = 0; i < size; i += DataTypes.SHORT_INT.getSizeInBytes()) { vector.putFloat(rowId++, (ByteUtil.valueOf3Bytes(pageData, i) / floatFactor)); int size = pageSize * DataTypes.SHORT_INT.getSizeInBytes(); for (int i = 0; i < size; i += DataTypes.SHORT_INT.getSizeInBytes()) { vector.putDouble(rowId++, (ByteUtil.valueOf3Bytes(pageData, i) / factor));
if (vectorDataType == DataTypes.INT) { for (int i = 0; i < size; i += DataTypes.SHORT_INT.getSizeInBytes()) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putInt(rowId++, (int) (max - shortInt)); int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putLong(rowId++, (max - shortInt)); vector.putLong(rowId++, (max - (long) ByteUtil.valueOf3Bytes(pageData, i)) * 1000); int precision = vectorInfo.measure.getMeasure().getPrecision(); for (int i = 0; i < pageSize; i++) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); BigDecimal decimal = decimalConverter.getDecimal(max - shortInt); if (decimal.scale() < newScale) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putFloat(rowId++, (int) (max - shortInt)); int shortInt = ByteUtil.valueOf3Bytes(pageData, i); vector.putDouble(rowId++, (max - shortInt));
if (vectorDataType == DataTypes.INT) { for (int i = 0; i < pageSize; i++) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putInt(i, shortInt); int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putLong(i, shortInt); int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putLong(i, (long) shortInt * 1000); } else if (vectorDataType == DataTypes.FLOAT) { for (int i = 0; i < pageSize; i++) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putFloat(i, shortInt); int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putDouble(i, shortInt);
if (vectorDataType == DataTypes.INT) { for (int i = 0; i < pageSize; i++) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putInt(i, shortInt); int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putLong(i, shortInt); int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putLong(i, (long) shortInt * 1000); } else { for (int i = 0; i < pageSize; i++) { int shortInt = ByteUtil.valueOf3Bytes(pageData, i * 3); vector.putDouble(i, shortInt);