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.
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 Summary
Fields inherited from class org.apache.drill.exec.store.AbstractRecordReader
DEFAULT_TEXT_COLS_TO_READ
Fields inherited from interface org.apache.drill.exec.store.RecordReader
ALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION
-
Constructor Summary
ConstructorDescriptionJSONRecordReader
(FragmentContext fragmentContext, com.fasterxml.jackson.databind.JsonNode embeddedContent, DrillFileSystem fileSystem, List<SchemaPath> columns) Deprecated.Create a new JSON Record Reader that uses an in memory materialized JSON stream.JSONRecordReader
(FragmentContext fragmentContext, List<SchemaPath> columns) Deprecated.Create a JSON Record Reader that uses an InputStream directlyJSONRecordReader
(FragmentContext fragmentContext, org.apache.hadoop.fs.Path inputPath, DrillFileSystem fileSystem, List<SchemaPath> columns, JSONFormatConfig config) Deprecated.Create a JSON Record Reader that uses a file based input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.protected List<SchemaPath>
Deprecated.protected void
handleAndRaise
(String suffix, Exception e) Deprecated.int
next()
Deprecated.Increments this record reader forward, writing via the provided output mutator into the output batch.void
Deprecated.void
setup
(OperatorContext context, OutputMutator output) Deprecated.Configure the RecordReader with the provided schema and the record batch that should be written to.toString()
Deprecated.Methods inherited from class org.apache.drill.exec.store.AbstractRecordReader
allocate, getColumns, hasNext, isSkipQuery, isStarQuery, setColumns, transformColumns
-
Field Details
-
DEFAULT_ROWS_PER_BATCH
public static final long DEFAULT_ROWS_PER_BATCHDeprecated.- 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 fragmentinputPath
- the input pathfileSystem
- a Drill file system wrapper around the file system implementationcolumns
- path names of columns/subfields to readconfig
- 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 fragmentembeddedContent
- embedded contentfileSystem
- a Drill file system wrapper around the file system implementationcolumns
- 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 fragmentcolumns
- 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
Deprecated.- Overrides:
toString
in classAbstractRecordReader
-
setup
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 readeroutput
- 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
Deprecated.- Overrides:
getDefaultColumnsToRead
in classAbstractRecordReader
-
handleAndRaise
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
Deprecated. -
close
Deprecated.- Throws:
Exception
-