public class CsvInputFormat
extends org.apache.flink.api.common.io.GenericCsvInputFormat<org.apache.flink.types.Record>
Configuration.
The number of fields to parse must be configured as well.
For each field a data type must be specified using the FIELD_TYPE_PARAMETER_PREFIX config key.
The position within the text record can be configured for each field using the TEXT_POSITION_PARAMETER_PREFIX config key.
Either all text positions must be configured or none. If none is configured, the index of the config key is used.
The position of a value within the Record is the index of the config key.Configuration,
Record,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
protected static class |
CsvInputFormat.AbstractConfigBuilder<T>
An abstract builder used to set parameters to the input format's configuration in a fluent way.
|
static class |
CsvInputFormat.ConfigBuilder
A builder used to set parameters to the input format's configuration in a fluent way.
|
| Constructor and Description |
|---|
CsvInputFormat() |
CsvInputFormat(char fieldDelimiter) |
CsvInputFormat(char fieldDelimiter,
Class<? extends org.apache.flink.types.Value>... fields) |
CsvInputFormat(Class<? extends org.apache.flink.types.Value>... fields) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.flink.configuration.Configuration config) |
static CsvInputFormat.ConfigBuilder |
configureRecordFormat(FileDataSource target)
Creates a configuration builder that can be used to set the input format's parameters to the config in a fluent
fashion.
|
void |
open(org.apache.flink.core.fs.FileInputSplit split) |
org.apache.flink.types.Record |
readRecord(org.apache.flink.types.Record reuse,
byte[] bytes,
int offset,
int numBytes) |
void |
setFields(int[] sourceFieldIndices,
Class<? extends org.apache.flink.types.Value>[] fieldTypes) |
void |
setFieldTypes(Class<? extends org.apache.flink.types.Value>... fieldTypes) |
void |
setFieldTypesArray(Class<? extends org.apache.flink.types.Value>[] fieldTypes) |
checkAndCoSort, checkForMonotonousOrder, close, enableQuotedStringParsing, getCommentPrefix, getFieldDelimiter, getFieldParsers, getGenericFieldTypes, getNumberOfFieldsTotal, getNumberOfNonNullFields, isLenient, isSkippingFirstLineAsHeader, parseRecord, setCommentPrefix, setCommentPrefix, setCommentPrefix, setCommentPrefix, setCommentPrefix, setFieldDelimiter, setFieldDelimiter, setFieldDelimiter, setFieldsGeneric, setFieldsGeneric, setFieldTypesGeneric, setLenient, setSkipFirstLineAsHeader, skipFieldsconfigureDelimitedFormat, getBufferSize, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, loadGloablConfigParams, nextRecord, reachedEnd, readLine, setBufferSize, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamplesacceptFile, configureFileFormat, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setMinSplitSize, setNumSplits, setOpenTimeout, testForUnsplittable, toStringpublic CsvInputFormat()
public CsvInputFormat(char fieldDelimiter)
public CsvInputFormat(Class<? extends org.apache.flink.types.Value>... fields)
public CsvInputFormat(char fieldDelimiter,
Class<? extends org.apache.flink.types.Value>... fields)
public void setFieldTypesArray(Class<? extends org.apache.flink.types.Value>[] fieldTypes)
public void setFieldTypes(Class<? extends org.apache.flink.types.Value>... fieldTypes)
public void setFields(int[] sourceFieldIndices,
Class<? extends org.apache.flink.types.Value>[] fieldTypes)
public void configure(org.apache.flink.configuration.Configuration config)
configure in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.fs.FileInputSplit>configure in class org.apache.flink.api.common.io.DelimitedInputFormat<org.apache.flink.types.Record>public void open(org.apache.flink.core.fs.FileInputSplit split)
throws IOException
open in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.fs.FileInputSplit>open in class org.apache.flink.api.common.io.GenericCsvInputFormat<org.apache.flink.types.Record>IOExceptionpublic org.apache.flink.types.Record readRecord(org.apache.flink.types.Record reuse,
byte[] bytes,
int offset,
int numBytes)
throws org.apache.flink.api.common.io.ParseException
readRecord in class org.apache.flink.api.common.io.DelimitedInputFormat<org.apache.flink.types.Record>org.apache.flink.api.common.io.ParseExceptionpublic static CsvInputFormat.ConfigBuilder configureRecordFormat(FileDataSource target)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.