OUT
- @Internal public abstract class CsvInputFormat<OUT> extends GenericCsvInputFormat<OUT>
FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FIELD_DELIMITER |
static String |
DEFAULT_LINE_DELIMITER |
protected Object[] |
parsedValues |
commentCount, commentPrefix, fieldIncluded, invalidLineCount, lineDelimiterIsLinebreak
currBuffer, currLen, currOffset, 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 |
CsvInputFormat(Path filePath) |
Modifier and Type | Method and Description |
---|---|
protected static boolean[] |
createDefaultMask(int size) |
protected abstract OUT |
fillRecord(OUT reuse,
Object[] parsedValues) |
Class<?>[] |
getFieldTypes() |
protected void |
initializeSplit(FileInputSplit split,
Long offset)
Initialization method that is called after opening or reopening an input split.
|
OUT |
nextRecord(OUT record)
Reads the next record from the input.
|
OUT |
readRecord(OUT reuse,
byte[] bytes,
int offset,
int numBytes)
This function parses the given byte array which represents a serialized record.
|
protected static boolean[] |
toBooleanMask(int[] sourceFieldIndices) |
String |
toString() |
checkAndCoSort, checkForMonotonousOrder, close, enableQuotedStringParsing, getCommentPrefix, getFieldDelimiter, getFieldParsers, getGenericFieldTypes, getNumberOfFieldsTotal, getNumberOfNonNullFields, isLenient, isSkippingFirstLineAsHeader, parseRecord, setCharset, setCommentPrefix, setFieldDelimiter, setFieldsGeneric, setFieldsGeneric, setFieldTypesGeneric, setLenient, setSkipFirstLineAsHeader, skipFields, supportsMultiPaths
configure, getBufferSize, getCharset, getCurrentState, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, loadConfigParameters, loadGlobalConfigParams, open, reachedEnd, readLine, reopen, setBufferSize, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
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
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public static final String DEFAULT_LINE_DELIMITER
public static final String DEFAULT_FIELD_DELIMITER
protected transient Object[] parsedValues
protected CsvInputFormat(Path filePath)
protected void initializeSplit(FileInputSplit split, Long offset) throws IOException
DelimitedInputFormat
initializeSplit
in class GenericCsvInputFormat<OUT>
split
- Split that was opened or reopenedoffset
- Checkpointed state if the split was reopenedIOException
public OUT nextRecord(OUT record) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
nextRecord
in interface InputFormat<OUT,FileInputSplit>
nextRecord
in class DelimitedInputFormat<OUT>
record
- Object that may be reused.IOException
- Thrown, if an I/O error occurred.public OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes) throws IOException
DelimitedInputFormat
readRecord
in class DelimitedInputFormat<OUT>
reuse
- An optionally reusable object.bytes
- Binary data of serialized records.offset
- The offset where to start to read the record data.numBytes
- The number of bytes that can be read starting at the offset position.IOException
- if the record could not be read.public Class<?>[] getFieldTypes()
protected static boolean[] createDefaultMask(int size)
protected static boolean[] toBooleanMask(int[] sourceFieldIndices)
public String toString()
toString
in class FileInputFormat<OUT>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.