public class CSVRecordReader extends LineRecordReader
| Modifier and Type | Field and Description |
|---|---|
static String |
DELIMITER |
static String |
SKIP_NUM_LINES |
conf, inputSplitAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
CSVRecordReader() |
CSVRecordReader(int skipNumLines)
Skip first n lines
|
CSVRecordReader(int skipNumLines,
String delimiter)
Skip lines and use delimiter
|
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
Collection<Writable> |
next()
Get the next record
|
Collection<Writable> |
record(URI uri,
DataInputStream dataInputStream)
Load the record from the given DataInputStream
Unlike
RecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStream |
close, getConf, getLabels, hasNext, initialize, reset, setConfpublic static final String SKIP_NUM_LINES
public static final String DELIMITER
public CSVRecordReader(int skipNumLines)
skipNumLines - the number of lines to skippublic CSVRecordReader(int skipNumLines,
String delimiter)
skipNumLines - the number of lines to skipdelimiter - the delimiterpublic CSVRecordReader()
public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class LineRecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic Collection<Writable> next()
RecordReadernext in interface RecordReadernext in class LineRecordReaderpublic Collection<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
RecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord in interface RecordReaderrecord in class LineRecordReaderIOException - if error occurs during reading from the input streamCopyright © 2016. All rights reserved.