Class JSONRecordReader

java.lang.Object
org.apache.drill.exec.store.AbstractRecordReader
org.apache.drill.exec.store.easy.json.JSONRecordReader
All Implemented Interfaces:
AutoCloseable, RecordReader

@Deprecated public class JSONRecordReader extends AbstractRecordReader
Deprecated.
Old-style JSON record reader. Not used when reading JSON files, but is used by some "mini-plan" unit tests, and by the VALUES reader. As a result, this reader cannot be removed and must be maintained until the other uses are converted to the new-style JSON reader - JsonBatchReader.
  • Field Details

    • DEFAULT_ROWS_PER_BATCH

      public static final long DEFAULT_ROWS_PER_BATCH
      Deprecated.
      See Also:
  • Constructor Details

    • JSONRecordReader

      public JSONRecordReader(FragmentContext fragmentContext, org.apache.hadoop.fs.Path inputPath, DrillFileSystem fileSystem, List<SchemaPath> columns, JSONFormatConfig config) throws OutOfMemoryException
      Deprecated.
      Create a JSON Record Reader that uses a file based input stream.
      Parameters:
      fragmentContext - the Drill fragment
      inputPath - the input path
      fileSystem - a Drill file system wrapper around the file system implementation
      columns - path names of columns/subfields to read
      config - The JSONFormatConfig for the storage plugin
      Throws:
      OutOfMemoryException - If there is insufficient memory, Drill will throw an Out of Memory Exception
    • JSONRecordReader

      public JSONRecordReader(FragmentContext fragmentContext, com.fasterxml.jackson.databind.JsonNode embeddedContent, DrillFileSystem fileSystem, List<SchemaPath> columns) throws OutOfMemoryException
      Deprecated.
      Create a new JSON Record Reader that uses an in memory materialized JSON stream.
      Parameters:
      fragmentContext - the Drill fragment
      embeddedContent - embedded content
      fileSystem - a Drill file system wrapper around the file system implementation
      columns - path names of columns/subfields to read
      Throws:
      OutOfMemoryException - If Drill runs out of memory, OME will be thrown
    • JSONRecordReader

      public JSONRecordReader(FragmentContext fragmentContext, List<SchemaPath> columns) throws OutOfMemoryException
      Deprecated.
      Create a JSON Record Reader that uses an InputStream directly
      Parameters:
      fragmentContext - the Drill fragment
      columns - path names of columns/subfields to read
      Throws:
      OutOfMemoryException - If there is insufficient memory, Drill will throw an Out of Memory Exception
  • Method Details

    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class AbstractRecordReader
    • setup

      public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException
      Deprecated.
      Description copied from interface: RecordReader
      Configure the RecordReader with the provided schema and the record batch that should be written to.
      Parameters:
      context - operator context for the reader
      output - The place where output for a particular scan should be written. The record reader is responsible for mutating the set of schema values for that particular record.
      Throws:
      ExecutionSetupException
    • getDefaultColumnsToRead

      protected List<SchemaPath> getDefaultColumnsToRead()
      Deprecated.
      Overrides:
      getDefaultColumnsToRead in class AbstractRecordReader
    • handleAndRaise

      protected void handleAndRaise(String suffix, Exception e) throws UserException
      Deprecated.
      Throws:
      UserException
    • next

      public int next()
      Deprecated.
      Description copied from interface: RecordReader
      Increments this record reader forward, writing via the provided output mutator into the output batch.
      Returns:
      The number of additional records added to the output.
    • setInputStream

      public void setInputStream(InputStream in)
      Deprecated.
    • close

      public void close() throws Exception
      Deprecated.
      Throws:
      Exception