Revert "fixed input source sampler buildReader exp"

This reverts commit e688db8
This commit is contained in:
egor-ryashin 2020-12-07 18:34:59 +03:00
parent e688db8503
commit f46cc4faaf
1 changed files with 73 additions and 85 deletions

View File

@ -103,7 +103,6 @@ public class InputSourceSampler
final File tempDir = FileUtils.createTempDir();
closer.register(() -> FileUtils.deleteDirectory(tempDir));
try {
final InputSourceReader reader = buildReader(
nonNullSamplerConfig,
nonNullDataSchema,
@ -127,12 +126,7 @@ public class InputSourceSampler
if (rawColumnsList != null) {
// add all rows to response
responseRows.addAll(rawColumnsList.stream()
.map(rawColumns -> new SamplerResponseRow(
rawColumns,
null,
true,
parseException.getMessage()
))
.map(rawColumns -> new SamplerResponseRow(rawColumns, null, true, parseException.getMessage()))
.collect(Collectors.toList()));
} else {
// no data parsed, add one response row
@ -155,12 +149,7 @@ public class InputSourceSampler
final int rowIndex = responseRows.size();
IncrementalIndexAddResult addResult = index.add(new SamplerInputRow(row, rowIndex), true);
if (addResult.hasParseException()) {
responseRows.add(new SamplerResponseRow(
rawColumns,
null,
true,
addResult.getParseException().getMessage()
));
responseRows.add(new SamplerResponseRow(rawColumns, null, true, addResult.getParseException().getMessage()));
} else {
// store the raw value; will be merged with the data from the IncrementalIndex later
responseRows.add(new SamplerResponseRow(rawColumns, null, null, null));
@ -199,7 +188,6 @@ public class InputSourceSampler
.collect(Collectors.toList())
);
}
}
catch (Exception e) {
throw new SamplerException(e, "Failed to sample data: %s", e.getMessage());
}