/** * Fill the data to vector * * @param vectorInfo * @param chunkIndex * @return next column index */ @Override public int fillVector(ColumnVectorInfo[] vectorInfo, int chunkIndex) { ColumnVectorInfo columnVectorInfo = vectorInfo[chunkIndex]; CarbonColumnVector vector = columnVectorInfo.vector; int offset = columnVectorInfo.offset; int vectorOffset = columnVectorInfo.vectorOffset; int len = offset + columnVectorInfo.size; for (int i = offset; i < len; i++) { // Considering only String case now as we support only // string in no dictionary case at present. dataChunkStore.fillRow(i, vector, vectorOffset++); } return chunkIndex + 1; }
/** * Fill the data to vector * * @param filteredRowId * @param vectorInfo * @param chunkIndex * @return next column index */ @Override public int fillVector(int[] filteredRowId, ColumnVectorInfo[] vectorInfo, int chunkIndex) { ColumnVectorInfo columnVectorInfo = vectorInfo[chunkIndex]; CarbonColumnVector vector = columnVectorInfo.vector; int offset = columnVectorInfo.offset; int vectorOffset = columnVectorInfo.vectorOffset; int len = offset + columnVectorInfo.size; for (int i = offset; i < len; i++) { // Considering only String case now as we support only // string in no dictionary case at present. dataChunkStore.fillRow(filteredRowId[i], vector, vectorOffset++); } return chunkIndex + 1; } }
/** * Below method will be used to fill the data based on offset and row id * * @param rowId row id of the chunk * @param offset offset from which data need to be filed * @param data data to filed * @return how many bytes was copied */ @Override public int fillRawData(int rowId, int offset, byte[] data) { dataChunkStore.fillRow(rowId, data, offset); return dataChunkStore.getColumnValueSize(); }