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 RecordReader
IOException
public long getRowNumber() throws IOException
getRowNumber
in interface RecordReader
IOException
public float getProgress() throws IOException
getProgress
in interface RecordReader
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface RecordReader
IOException
public void seekToRow(long rowCount) throws IOException
seekToRow
in interface RecordReader
IOException
Copyright © 2013–2023 The Apache Software Foundation. All rights reserved.