use of org.apache.carbondata.processing.loading.exception.NoRetryException in project carbondata by apache.
the class DataLoadExecutor method execute.
public void execute(CarbonLoadModel loadModel, String[] storeLocation, CarbonIterator<Object[]>[] inputIterators) throws Exception {
try {
loadProcessorStep = new DataLoadProcessBuilder().build(loadModel, storeLocation, inputIterators);
// 1. initialize
loadProcessorStep.initialize();
LOGGER.info("Data Loading is started for table " + loadModel.getTableName());
// 2. execute the step
loadProcessorStep.execute();
// check and remove any bad record key from bad record entry logger static map
if (CarbonBadRecordUtil.hasBadRecord(loadModel)) {
LOGGER.error("Data Load is partially success for table " + loadModel.getTableName());
} else {
LOGGER.info("Data loading is successful for table " + loadModel.getTableName());
}
} catch (CarbonDataLoadingException e) {
if (e instanceof BadRecordFoundException) {
throw new NoRetryException(e.getMessage());
} else {
throw e;
}
} catch (Exception e) {
LOGGER.error(e, "Data Loading failed for table " + loadModel.getTableName());
throw new CarbonDataLoadingException("Data Loading failed for table " + loadModel.getTableName(), e);
}
}
Aggregations