public class CsvReader extends Object implements RecordReader
| Constructor and Description |
|---|
CsvReader(Reader reader,
FSDataInputStream input,
long size,
TypeDescription schema,
char separatorChar,
char quoteChar,
char escapeChar,
int headerLines,
String nullString,
String timestampFormat)
Create a CSV reader
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
float |
getProgress() |
long |
getRowNumber() |
boolean |
nextBatch(VectorizedRowBatch batch) |
void |
seekToRow(long rowCount) |
public CsvReader(Reader reader, FSDataInputStream input, long size, TypeDescription schema, char separatorChar, char quoteChar, char escapeChar, int headerLines, String nullString, String timestampFormat)
reader - the stream to read frominput - the underlying file that is only used for getting the
position within the filesize - the number of bytes in the underlying streamschema - the schema to read intoseparatorChar - the character between fieldsquoteChar - the quote characterescapeChar - the escape characterheaderLines - the number of header linesnullString - the string that is translated to nulltimestampFormat - the timestamp format stringpublic boolean nextBatch(VectorizedRowBatch batch) throws IOException
nextBatch in interface RecordReaderIOExceptionpublic long getRowNumber()
throws IOException
getRowNumber in interface RecordReaderIOExceptionpublic float getProgress()
throws IOException
getProgress in interface RecordReaderIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface RecordReaderIOExceptionpublic void seekToRow(long rowCount)
throws IOException
seekToRow in interface RecordReaderIOExceptionCopyright © 2013–2021 The Apache Software Foundation. All rights reserved.