@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++) { fillRow(filteredRowId[i], vector, vectorOffset++); } return chunkIndex + 1; }
@Override public byte[] getChunkData(int rowId) { byte[] nullBitSet = getNullBitSet(rowId, columnPage.getColumnSpec().getColumnType()); if (nullBitSet != null) { // if this row is null, return default null represent in byte array return nullBitSet; } else { if (isExplicitSorted()) { rowId = getInvertedReverseIndex(rowId); } return getChunkDataInBytes(rowId); } }
@Override public int compareTo(int rowId, byte[] compareValue) { // rowId is the inverted index, but the null bitset is based on actual data int nullBitSetRowId = rowId; if (isExplicitSorted()) { nullBitSetRowId = getInvertedIndex(rowId); } byte[] nullBitSet = getNullBitSet(nullBitSetRowId, columnPage.getColumnSpec().getColumnType()); if (nullBitSet != null && ByteUtil.UnsafeComparer.INSTANCE.compareTo(nullBitSet, compareValue) == 0) { // check if the compare value is a null value // if the compare value is null and the data is also null we can directly return 0 return 0; } else { byte[] chunkData = this.getChunkDataInBytes(rowId); return ByteUtil.UnsafeComparer.INSTANCE.compareTo(chunkData, compareValue); } }
return localDictionary .getDictionaryValue(CarbonUtil.getSurrogateInternal(columnPage.getBytes(rowId), 0, 3)); } else if ((columnType == ColumnType.COMPLEX_PRIMITIVE && isAdaptiveEncoded()) || ( columnType == ColumnType.PLAIN_VALUE && DataTypeUtil.isPrimitiveColumn(srcDataType))) { if (srcDataType == DataTypes.FLOAT) { throw new RuntimeException("unsupported type: " + targetDataType); } else if ((columnType == ColumnType.COMPLEX_PRIMITIVE && !isAdaptiveEncoded())) { if ((srcDataType == DataTypes.BYTE) || (srcDataType == DataTypes.BOOLEAN)) { byte[] out = new byte[1];
decodedPage.setNullBits(nullBitSet); return new ColumnPageWrapper(decodedPage, rawColumnPage.getLocalDictionary(), invertedIndexes, invertedIndexesReverse, isEncodedWithAdaptiveMeta(pageMetadata), isExplicitSorted); } else {
@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++) { fillRow(i, vector, vectorOffset++); } return chunkIndex + 1; }