fix orcFileStartRead

This commit is contained in:
wangchuande 2019-01-22 18:30:51 +08:00
parent d4d1ea6a15
commit e2dcbcd532

View File

@ -331,9 +331,11 @@ public class DFSUtil {
//If the network disconnected, will retry 45 times, each time the retry interval for 20 seconds
//Each file as a split
//TODO multy threads
InputSplit[] splits = in.getSplits(conf, 1);
RecordReader reader = in.getRecordReader(splits[0], conf, Reporter.NULL);
// OrcInputFormat getSplits params numSplits not used, splits size = block numbers
InputSplit[] splits = in.getSplits(conf, -1);
for (InputSplit split : splits) {
{
RecordReader reader = in.getRecordReader(split, conf, Reporter.NULL);
Object key = reader.createKey();
Object value = reader.createValue();
// 获取列信息
@ -351,6 +353,8 @@ public class DFSUtil {
taskPluginCollector, isReadAllColumns, nullFormat);
}
reader.close();
}
}
} catch (Exception e) {
String message = String.format("从orcfile文件路径[%s]中读取数据发生异常,请联系系统管理员。"
, sourceOrcFilePath);