Package org.apache.flink.api.java.io
Class CsvInputFormat<OUT>
- java.lang.Object
-
- org.apache.flink.api.common.io.RichInputFormat<OT,org.apache.flink.core.fs.FileInputSplit>
-
- org.apache.flink.api.common.io.FileInputFormat<OT>
-
- org.apache.flink.api.common.io.DelimitedInputFormat<OT>
-
- org.apache.flink.api.common.io.GenericCsvInputFormat<OUT>
-
- org.apache.flink.api.java.io.CsvInputFormat<OUT>
-
- Type Parameters:
OUT-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.io.CheckpointableInputFormat<org.apache.flink.core.fs.FileInputSplit,Long>,org.apache.flink.api.common.io.InputFormat<OUT,org.apache.flink.core.fs.FileInputSplit>,org.apache.flink.core.io.InputSplitSource<org.apache.flink.core.fs.FileInputSplit>
- Direct Known Subclasses:
PojoCsvInputFormat,RowCsvInputFormat,TupleCsvInputFormat
@Internal public abstract class CsvInputFormat<OUT> extends org.apache.flink.api.common.io.GenericCsvInputFormat<OUT>InputFormat that reads csv files.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_FIELD_DELIMITERstatic StringDEFAULT_LINE_DELIMITERprotected Object[]parsedValues-
Fields inherited from class org.apache.flink.api.common.io.GenericCsvInputFormat
commentCount, commentPrefix, fieldIncluded, invalidLineCount, lineDelimiterIsLinebreak
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCsvInputFormat(org.apache.flink.core.fs.Path filePath)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static boolean[]createDefaultMask(int size)protected abstract OUTfillRecord(OUT reuse, Object[] parsedValues)Class<?>[]getFieldTypes()protected voidinitializeSplit(org.apache.flink.core.fs.FileInputSplit split, Long offset)OUTnextRecord(OUT record)OUTreadRecord(OUT reuse, byte[] bytes, int offset, int numBytes)protected static boolean[]toBooleanMask(int[] sourceFieldIndices)StringtoString()-
Methods inherited from class org.apache.flink.api.common.io.GenericCsvInputFormat
checkAndCoSort, checkForMonotonousOrder, close, enableQuotedStringParsing, getCommentPrefix, getFieldDelimiter, getFieldParsers, getGenericFieldTypes, getNumberOfFieldsTotal, getNumberOfNonNullFields, isLenient, isSkippingFirstLineAsHeader, parseRecord, setCharset, setCommentPrefix, setFieldDelimiter, setFieldsGeneric, setFieldsGeneric, setFieldTypesGeneric, setLenient, setSkipFirstLineAsHeader, skipFields, supportsMultiPaths
-
Methods inherited from class org.apache.flink.api.common.io.DelimitedInputFormat
configure, getBufferSize, getCharset, getCurrentState, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, loadConfigParameters, loadGlobalConfigParams, open, reachedEnd, readLine, reopen, setBufferSize, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
-
Methods inherited from class org.apache.flink.api.common.io.FileInputFormat
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFilePaths, getFileStats, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNestedFileEnumeration, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setFilePaths, setFilePaths, setFilesFilter, setMinSplitSize, setNestedFileEnumeration, setNumSplits, setOpenTimeout, testForUnsplittable
-
-
-
-
Field Detail
-
DEFAULT_LINE_DELIMITER
public static final String DEFAULT_LINE_DELIMITER
- See Also:
- Constant Field Values
-
DEFAULT_FIELD_DELIMITER
public static final String DEFAULT_FIELD_DELIMITER
- See Also:
- Constant Field Values
-
parsedValues
protected transient Object[] parsedValues
-
-
Method Detail
-
initializeSplit
protected void initializeSplit(org.apache.flink.core.fs.FileInputSplit split, Long offset) throws IOException- Overrides:
initializeSplitin classorg.apache.flink.api.common.io.GenericCsvInputFormat<OUT>- Throws:
IOException
-
nextRecord
public OUT nextRecord(OUT record) throws IOException
- Specified by:
nextRecordin interfaceorg.apache.flink.api.common.io.InputFormat<OUT,org.apache.flink.core.fs.FileInputSplit>- Overrides:
nextRecordin classorg.apache.flink.api.common.io.DelimitedInputFormat<OUT>- Throws:
IOException
-
readRecord
public OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes) throws IOException
- Specified by:
readRecordin classorg.apache.flink.api.common.io.DelimitedInputFormat<OUT>- Throws:
IOException
-
getFieldTypes
public Class<?>[] getFieldTypes()
-
createDefaultMask
protected static boolean[] createDefaultMask(int size)
-
toBooleanMask
protected static boolean[] toBooleanMask(int[] sourceFieldIndices)
-
-