use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by apache.
the class JSONRecordReader method setup.
@Override
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException {
try {
if (hadoopPath != null) {
stream = fileSystem.openPossiblyCompressedStream(hadoopPath);
}
writer = new VectorContainerWriter(output, unionEnabled);
if (isSkipQuery()) {
jsonReader = new CountingJsonReader(fragmentContext.getManagedBuffer(), enableNanInf, enableEscapeAnyChar);
} else {
this.jsonReader = new JsonReader.Builder(fragmentContext.getManagedBuffer()).schemaPathColumns(ImmutableList.copyOf(getColumns())).allTextMode(enableAllTextMode).skipOuterList(true).readNumbersAsDouble(readNumbersAsDouble).enableNanInf(enableNanInf).enableEscapeAnyChar(enableEscapeAnyChar).build();
}
setupParser();
} catch (Exception e) {
handleAndRaise("Failure reading JSON file", e);
}
}
Aggregations