use of org.apache.carbondata.processing.newflow.converter.RowConverter in project carbondata by apache.
the class DataConverterProcessorStepImpl method initialize.
@Override
public void initialize() throws IOException {
child.initialize();
converters = new ArrayList<>();
badRecordLogger = createBadRecordLogger();
RowConverter converter = new RowConverterImpl(child.getOutput(), configuration, badRecordLogger);
configuration.setCardinalityFinder(converter);
converters.add(converter);
converter.initialize();
}
use of org.apache.carbondata.processing.newflow.converter.RowConverter in project carbondata by apache.
the class DataConverterProcessorWithBucketingStepImpl method initialize.
@Override
public void initialize() throws IOException {
child.initialize();
converters = new ArrayList<>();
badRecordLogger = createBadRecordLogger();
RowConverter converter = new RowConverterImpl(child.getOutput(), configuration, badRecordLogger);
configuration.setCardinalityFinder(converter);
converters.add(converter);
converter.initialize();
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;
}
}
}
partitioner = new HashPartitionerImpl(indexes, columnSchemas, bucketingInfo.getNumberOfBuckets());
}
use of org.apache.carbondata.processing.newflow.converter.RowConverter in project carbondata by apache.
the class DataConverterProcessorStepImpl method close.
@Override
public void close() {
if (!closed) {
if (null != badRecordLogger) {
badRecordLogger.closeStreams();
// rename the bad record in progress to normal
CarbonTableIdentifier identifier = configuration.getTableIdentifier().getCarbonTableIdentifier();
CarbonDataProcessorUtil.renameBadRecordsFromInProgressToNormal(identifier.getDatabaseName() + File.separator + identifier.getTableName() + File.separator + configuration.getSegmentId() + File.separator + configuration.getTaskNo());
}
super.close();
if (converters != null) {
for (RowConverter converter : converters) {
converter.finish();
}
}
}
}
Aggregations