@Override public byte[] getComplexChildrenLVFlattenedBytePage() throws IOException { // output LV encoded byte array int offset = 0; byte[] data = new byte[totalLength + ((rowOffset.getActualRowCount() - 1) * 2)]; for (int rowId = 0; rowId < rowOffset.getActualRowCount() - 1; rowId++) { short length = (short) (rowOffset.getInt(rowId + 1) - rowOffset.getInt(rowId)); ByteUtil.setShort(data, offset, length); copyBytes(rowId, data, offset + 2, length); offset += 2 + length; } return data; }
@Override public BigDecimal getDecimal(int rowId) { // rowOffset is initialed for query in `VarLengthColumnPageBase.getDecimalColumnPage` // if its size is 0, we are in loading process and the data in column page is raw if (rowOffset.getActualRowCount() == 0) { return getDecimalFromRawData(rowId); } else { return getDecimalFromDecompressData(rowId); } }
Object[] data = new Object[input.getActualRowCount()]; if (srcDataType == DataTypes.BYTE || srcDataType == DataTypes.BOOLEAN) { for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getByte(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getShort(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getShortInt(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getInt(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getLong(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getFloat(i); for (int i = 0; i < input.getActualRowCount(); i++) { data[i] = input.getDouble(i);
@Override public byte[] getLVFlattenedBytePage() throws IOException { // output LV encoded byte array int offset = 0; byte[] data = new byte[totalLength + ((rowOffset.getActualRowCount() - 1) * 4)]; for (int rowId = 0; rowId < rowOffset.getActualRowCount() - 1; rowId++) { int length = rowOffset.getInt(rowId + 1) - rowOffset.getInt(rowId); ByteUtil.setInt(data, offset, length); copyBytes(rowId, data, offset + 4, length); offset += 4 + length; } return data; }
@Override public byte[][] getByteArrayPage() { byte[][] bytes = new byte[rowOffset.getActualRowCount() - 1][]; for (int rowId = 0; rowId < rowOffset.getActualRowCount() - 1; rowId++) { int length = rowOffset.getInt(rowId + 1) - rowOffset.getInt(rowId); byte[] rowData = new byte[length]; CarbonUnsafe.getUnsafe().copyMemory(baseAddress, baseOffset + rowOffset.getInt(rowId), rowData, CarbonUnsafe.BYTE_ARRAY_OFFSET, length); bytes[rowId] = rowData; } return bytes; }
@Override public byte[] getComplexParentFlattenedBytePage() throws IOException { // output LV encoded byte array int offset = 0; byte[] data = new byte[totalLength]; for (int rowId = 0; rowId < rowOffset.getActualRowCount() - 1; rowId++) { int length = (rowOffset.getInt(rowId + 1) - rowOffset.getInt(rowId)); copyBytes(rowId, data, offset, length); offset += length; } return data; }