use of org.apache.carbondata.processing.datatypes.GenericDataType in project carbondata by apache.
the class CarbonFactDataHandlerColumnar method setComplexMapSurrogateIndex.
private void setComplexMapSurrogateIndex(int dimensionCount) {
int surrIndex = 0;
for (int i = 0; i < dimensionCount; i++) {
GenericDataType complexDataType = model.getComplexIndexMap().get(i);
if (complexDataType != null) {
List<GenericDataType> primitiveTypes = new ArrayList<GenericDataType>();
complexDataType.getAllPrimitiveChildren(primitiveTypes);
for (GenericDataType eachPrimitive : primitiveTypes) {
eachPrimitive.setSurrogateIndex(surrIndex++);
}
} else {
surrIndex++;
}
}
}
use of org.apache.carbondata.processing.datatypes.GenericDataType in project carbondata by apache.
the class CarbonFactDataHandlerColumnar method getExpandedComplexColsCount.
// return the number of complex column after complex columns are expanded
private int getExpandedComplexColsCount() {
int count = 0;
int dictDimensionCount = model.getDimensionCount();
for (int i = 0; i < dictDimensionCount; i++) {
GenericDataType complexDataType = model.getComplexIndexMap().get(i);
if (complexDataType != null) {
count += complexDataType.getColsCount();
}
}
return count;
}
use of org.apache.carbondata.processing.datatypes.GenericDataType in project carbondata by apache.
the class CarbonFactDataHandlerColumnar method getBlockKeySizeWithComplexTypes.
/**
* This method combines primitive dimensions with complex metadata columns
*
* @param primitiveBlockKeySize
* @return all dimensions cardinality including complex dimension metadata column
*/
private int[] getBlockKeySizeWithComplexTypes(int[] primitiveBlockKeySize) {
int allColsCount = getExpandedComplexColsCount();
int[] blockKeySizeWithComplexTypes = new int[this.colGrpModel.getNoOfColumnStore() + allColsCount];
List<Integer> blockKeySizeWithComplex = new ArrayList<Integer>(blockKeySizeWithComplexTypes.length);
int dictDimensionCount = model.getDimensionCount();
for (int i = 0; i < dictDimensionCount; i++) {
GenericDataType complexDataType = model.getComplexIndexMap().get(i);
if (complexDataType != null) {
complexDataType.fillBlockKeySize(blockKeySizeWithComplex, primitiveBlockKeySize);
} else {
blockKeySizeWithComplex.add(primitiveBlockKeySize[i]);
}
}
for (int i = 0; i < blockKeySizeWithComplexTypes.length; i++) {
blockKeySizeWithComplexTypes[i] = blockKeySizeWithComplex.get(i);
}
return blockKeySizeWithComplexTypes;
}
Aggregations