in core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/directread/ColumnarVectorWrapperDirectWithDeleteDeltaAndInvertedIndex.java [87:197]
public void convert() {
if (columnVector instanceof CarbonColumnVectorImpl) {
CarbonColumnVectorImpl localVector = (CarbonColumnVectorImpl) columnVector;
DataType dataType = columnVector.getType();
int length = invertedIndex.length;
int counter = 0;
if (dataType == DataTypes.BOOLEAN || dataType == DataTypes.BYTE) {
byte[] dataArray = (byte[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putByte(counter++, dataArray[i]);
}
}
}
} else if (dataType == DataTypes.SHORT) {
short[] dataArray = (short[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putShort(counter++, dataArray[i]);
}
}
}
} else if (dataType == DataTypes.INT) {
int[] dataArray = (int[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putInt(counter++, dataArray[i]);
}
}
}
} else if (dataType == DataTypes.LONG || dataType == DataTypes.TIMESTAMP) {
long[] dataArray = (long[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putLong(counter++, dataArray[i]);
}
}
}
} else if (dataType == DataTypes.FLOAT) {
float[] dataArray = (float[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putFloat(counter++, dataArray[i]);
}
}
}
} else if (dataType == DataTypes.DOUBLE) {
double[] dataArray = (double[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putDouble(counter++, dataArray[i]);
}
}
}
} else if (dataType instanceof DecimalType) {
BigDecimal[] dataArray = (BigDecimal[]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putDecimal(counter++, dataArray[i], precision);
}
}
}
} else if (dataType == DataTypes.STRING || dataType == DataTypes.BYTE_ARRAY) {
int[] offsets = localVector.getOffsets();
int[] lengths = localVector.getLengths();
if (offsets != null && lengths != null) {
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putArray(counter++, offsets[i], lengths[i]);
}
}
}
} else {
byte[][] dataArray = (byte[][]) localVector.getDataArray();
for (int i = 0; i < length; i++) {
if (!deletedRows.get(i)) {
if (nullBits.get(i)) {
carbonColumnVector.putNull(counter++);
} else {
carbonColumnVector.putByteArray(counter++, dataArray[i]);
}
}
}
}
}
}
}