RecordReader 'Infer Schema' for large records may throw BufferedInputStream error
This closes
@@ -46,7 +46,6 @@ import org.apache.nifi.serialization.SchemaRegistryService;
import org.apache.nifi.serialization.record.RecordSchema;
import org.codehaus.jackson.JsonNode;
-import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -164,9 +163,8 @@ public class JsonPathReader extends SchemaRegistryService implements RecordReade
@Override
public RecordReader createRecordReader(final Map<String, String> variables, final InputStream in, final long inputLength, final ComponentLog logger)
throws IOException, MalformedRecordException, SchemaNotFoundException {
- final InputStream bufferedIn = new BufferedInputStream(in);
- final RecordSchema schema = getSchema(variables, bufferedIn, null);
- return new JsonPathRowRecordReader(jsonPaths, schema, bufferedIn, logger, dateFormat, timeFormat, timestampFormat);
+ final RecordSchema schema = getSchema(variables, in, null);
+ return new JsonPathRowRecordReader(jsonPaths, schema, in, logger, dateFormat, timeFormat, timestampFormat);
}
}
