Class CSVRecordReader
- java.lang.Object
-
- org.apache.pinot.plugin.inputformat.csv.CSVRecordReader
-
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,RecordReader
@NotThreadSafe public class CSVRecordReader extends Object implements RecordReader
Record reader for CSV file.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CSVRecordReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Map<String,Integer>getCSVHeaderMap()Returns a copy of the header map that iterates in column order.booleanhasNext()voidinit(File dataFile, Set<String> fieldsToRead, RecordReaderConfig recordReaderConfig)GenericRownext()GenericRownext(GenericRow reuse)voidrewind()
-
-
-
Method Detail
-
init
public void init(File dataFile, @Nullable Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws IOException
- Specified by:
initin interfaceRecordReader- Throws:
IOException
-
getCSVHeaderMap
public Map<String,Integer> getCSVHeaderMap()
Returns a copy of the header map that iterates in column order.The map keys are column names. The map values are 0-based indices.
- Returns:
- a copy of the header map that iterates in column order.
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceRecordReader
-
next
public GenericRow next() throws IOException
- Specified by:
nextin interfaceRecordReader- Throws:
IOException
-
next
public GenericRow next(GenericRow reuse) throws IOException
- Specified by:
nextin interfaceRecordReader- Throws:
IOException
-
rewind
public void rewind() throws IOException- Specified by:
rewindin interfaceRecordReader- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-