public class JSONRecordReader extends AbstractRecordReader
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ROWS_PER_BATCH |
DEFAULT_TEXT_COLS_TO_READ
ALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION
Constructor and Description |
---|
JSONRecordReader(FragmentContext fragmentContext,
com.fasterxml.jackson.databind.JsonNode embeddedContent,
DrillFileSystem fileSystem,
List<SchemaPath> columns)
Create a new JSON Record Reader that uses a in memory materialized JSON stream.
|
JSONRecordReader(FragmentContext fragmentContext,
List<SchemaPath> columns)
Create a JSON Record Reader that uses an InputStream directly
|
JSONRecordReader(FragmentContext fragmentContext,
org.apache.hadoop.fs.Path inputPath,
DrillFileSystem fileSystem,
List<SchemaPath> columns)
Create a JSON Record Reader that uses a file based input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected List<SchemaPath> |
getDefaultColumnsToRead() |
protected void |
handleAndRaise(String suffix,
Exception e) |
int |
next()
Increments this record reader forward, writing via the provided output
mutator into the output batch.
|
void |
setInputStream(InputStream in) |
void |
setup(OperatorContext context,
OutputMutator output)
Configure the RecordReader with the provided schema and the record batch that should be written to.
|
String |
toString() |
allocate, getColumns, hasNext, isSkipQuery, isStarQuery, setColumns, transformColumns
public static final long DEFAULT_ROWS_PER_BATCH
public JSONRecordReader(FragmentContext fragmentContext, org.apache.hadoop.fs.Path inputPath, DrillFileSystem fileSystem, List<SchemaPath> columns) throws OutOfMemoryException
fragmentContext
- the Drill fragmentinputPath
- the input pathfileSystem
- a Drill file system wrapper around the file system implementationcolumns
- path names of columns/subfields to readOutOfMemoryException
public JSONRecordReader(FragmentContext fragmentContext, com.fasterxml.jackson.databind.JsonNode embeddedContent, DrillFileSystem fileSystem, List<SchemaPath> columns) throws OutOfMemoryException
fragmentContext
- the Drill fragmentembeddedContent
- embedded contentfileSystem
- a Drill file system wrapper around the file system implementationcolumns
- path names of columns/subfields to readOutOfMemoryException
public JSONRecordReader(FragmentContext fragmentContext, List<SchemaPath> columns) throws OutOfMemoryException
fragmentContext
- the Drill fragmentcolumns
- path names of columns/subfields to readOutOfMemoryException
public String toString()
toString
in class AbstractRecordReader
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException
RecordReader
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.ExecutionSetupException
protected List<SchemaPath> getDefaultColumnsToRead()
getDefaultColumnsToRead
in class AbstractRecordReader
protected void handleAndRaise(String suffix, Exception e) throws UserException
UserException
public int next()
RecordReader
public void setInputStream(InputStream in)
Copyright © 1970 The Apache Software Foundation. All rights reserved.