@Internal public abstract class GenericCsvInputFormat<OT> extends DelimitedInputFormat<OT>
FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
Modifier and Type | Field and Description |
---|---|
protected int |
commentCount |
protected byte[] |
commentPrefix |
protected boolean[] |
fieldIncluded |
protected int |
invalidLineCount |
protected boolean |
lineDelimiterIsLinebreak |
RECORD_DELIMITER
currentSplit, ENUMERATE_NESTED_FILES_FLAG, enumerateNestedFiles, filePath, INFLATER_INPUT_STREAM_FACTORIES, minSplitSize, numSplits, openTimeout, READ_WHOLE_SPLIT_FLAG, splitLength, splitStart, stream, unsplittable
Modifier | Constructor and Description |
---|---|
protected |
GenericCsvInputFormat() |
protected |
GenericCsvInputFormat(Path filePath) |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkAndCoSort(int[] positions,
Class<?>[] types) |
protected static void |
checkForMonotonousOrder(int[] positions,
Class<?>[] types) |
void |
close()
Closes the input by releasing all buffers and closing the file input stream.
|
void |
enableQuotedStringParsing(char quoteCharacter) |
byte[] |
getCommentPrefix() |
byte[] |
getFieldDelimiter() |
protected FieldParser<?>[] |
getFieldParsers() |
protected Class<?>[] |
getGenericFieldTypes() |
int |
getNumberOfFieldsTotal() |
int |
getNumberOfNonNullFields() |
boolean |
isLenient() |
boolean |
isSkippingFirstLineAsHeader() |
void |
open(FileInputSplit split)
Opens the given input split.
|
protected boolean |
parseRecord(Object[] holders,
byte[] bytes,
int offset,
int numBytes) |
void |
setCommentPrefix(byte[] commentPrefix) |
void |
setCommentPrefix(char commentPrefix) |
void |
setCommentPrefix(String commentPrefix) |
void |
setCommentPrefix(String commentPrefix,
Charset charset) |
void |
setCommentPrefix(String commentPrefix,
String charsetName) |
void |
setFieldDelimiter(byte[] delimiter) |
void |
setFieldDelimiter(char delimiter) |
void |
setFieldDelimiter(String delimiter) |
protected void |
setFieldsGeneric(boolean[] includedMask,
Class<?>[] fieldTypes) |
protected void |
setFieldsGeneric(int[] sourceFieldIndices,
Class<?>[] fieldTypes) |
protected void |
setFieldTypesGeneric(Class<?>... fieldTypes) |
void |
setLenient(boolean lenient) |
void |
setSkipFirstLineAsHeader(boolean skipFirstLine) |
protected int |
skipFields(byte[] bytes,
int startPos,
int limit,
byte[] delim) |
configure, getBufferSize, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, loadGlobalConfigParams, nextRecord, reachedEnd, readLine, readRecord, setBufferSize, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setMinSplitSize, setNumSplits, setOpenTimeout, testForUnsplittable, toString
getRuntimeContext, setRuntimeContext
protected boolean lineDelimiterIsLinebreak
protected transient int commentCount
protected transient int invalidLineCount
protected boolean[] fieldIncluded
protected byte[] commentPrefix
protected GenericCsvInputFormat()
protected GenericCsvInputFormat(Path filePath)
public int getNumberOfFieldsTotal()
public int getNumberOfNonNullFields()
public byte[] getCommentPrefix()
public void setCommentPrefix(byte[] commentPrefix)
public void setCommentPrefix(char commentPrefix)
public void setCommentPrefix(String commentPrefix)
public void setCommentPrefix(String commentPrefix, String charsetName) throws IllegalCharsetNameException, UnsupportedCharsetException
public byte[] getFieldDelimiter()
public void setFieldDelimiter(byte[] delimiter)
public void setFieldDelimiter(char delimiter)
public void setFieldDelimiter(String delimiter)
public boolean isLenient()
public void setLenient(boolean lenient)
public boolean isSkippingFirstLineAsHeader()
public void setSkipFirstLineAsHeader(boolean skipFirstLine)
public void enableQuotedStringParsing(char quoteCharacter)
protected FieldParser<?>[] getFieldParsers()
protected Class<?>[] getGenericFieldTypes()
protected void setFieldTypesGeneric(Class<?>... fieldTypes)
protected void setFieldsGeneric(int[] sourceFieldIndices, Class<?>[] fieldTypes)
protected void setFieldsGeneric(boolean[] includedMask, Class<?>[] fieldTypes)
public void open(FileInputSplit split) throws IOException
DelimitedInputFormat
open
in interface InputFormat<OT,FileInputSplit>
open
in class DelimitedInputFormat<OT>
split
- The input split to open.IOException
- Thrown, if the spit could not be opened due to an I/O problem.FileInputFormat.open(org.apache.flink.core.fs.FileInputSplit)
public void close() throws IOException
DelimitedInputFormat
close
in interface InputFormat<OT,FileInputSplit>
close
in class DelimitedInputFormat<OT>
IOException
- Thrown, if the closing of the file stream causes an I/O error.protected boolean parseRecord(Object[] holders, byte[] bytes, int offset, int numBytes) throws ParseException
ParseException
protected int skipFields(byte[] bytes, int startPos, int limit, byte[] delim)
protected static void checkAndCoSort(int[] positions, Class<?>[] types)
protected static void checkForMonotonousOrder(int[] positions, Class<?>[] types)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.