Search in sources :

Example 1 with DataField

use of org.apache.carbondata.processing.loading.DataField in project carbondata by apache.

the class DataConverterProcessorStepImpl method initializeBucketColumnPartitioner.

/**
 * initialize partitioner for bucket column
 */
private void initializeBucketColumnPartitioner() {
    List<Integer> indexes = new ArrayList<>();
    List<ColumnSchema> columnSchemas = new ArrayList<>();
    DataField[] inputDataFields = getOutput();
    BucketingInfo bucketingInfo = configuration.getBucketingInfo();
    for (int i = 0; i < inputDataFields.length; i++) {
        for (int j = 0; j < bucketingInfo.getListOfColumns().size(); j++) {
            if (inputDataFields[i].getColumn().getColName().equals(bucketingInfo.getListOfColumns().get(j).getColumnName())) {
                indexes.add(i);
                columnSchemas.add(inputDataFields[i].getColumn().getColumnSchema());
                break;
            }
        }
    }
    // hash partitioner to dispatch rows by bucket column
    this.partitioner = new HashPartitionerImpl(indexes, columnSchemas, bucketingInfo.getNumOfRanges());
}
Also used : BucketingInfo(org.apache.carbondata.core.metadata.schema.BucketingInfo) DataField(org.apache.carbondata.processing.loading.DataField) HashPartitionerImpl(org.apache.carbondata.processing.loading.partition.impl.HashPartitionerImpl) ArrayList(java.util.ArrayList) ColumnSchema(org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema)

Example 2 with DataField

use of org.apache.carbondata.processing.loading.DataField in project carbondata by apache.

the class CarbonDataProcessorUtil method getComplexTypeString.

private static String getComplexTypeString(DataField[] dataFields) {
    StringBuilder dimString = new StringBuilder();
    for (DataField dataField : dataFields) {
        if (dataField.getColumn().getDataType().isComplexType()) {
            addAllComplexTypeChildren((CarbonDimension) dataField.getColumn(), dimString, "");
            dimString.append(CarbonCommonConstants.SEMICOLON_SPC_CHARACTER);
        }
    }
    return dimString.toString();
}
Also used : DataField(org.apache.carbondata.processing.loading.DataField)

Aggregations

DataField (org.apache.carbondata.processing.loading.DataField)2 ArrayList (java.util.ArrayList)1 BucketingInfo (org.apache.carbondata.core.metadata.schema.BucketingInfo)1 ColumnSchema (org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema)1 HashPartitionerImpl (org.apache.carbondata.processing.loading.partition.impl.HashPartitionerImpl)1