public class DelimitedTextFileReader extends java.lang.Object implements DataStoreReader<java.util.List<java.lang.String>>
DelimitedTextFileReader
is a DataStoreReader
implementation
able to read String
s from a raw hdfs files as delimited fields.Modifier and Type | Field and Description |
---|---|
static byte[] |
CSV
CSV Mode
|
static byte[] |
TAB
TAB Mode
|
Constructor and Description |
---|
DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new delimited text file reader.
|
DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
byte[] fieldDelimiter)
Instantiates a new delimited text file reader.
|
DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
Split inputSplit,
byte[] fieldDelimiter,
byte[] textDelimiter)
Instantiates a new delimited text file reader.
|
public static final byte[] CSV
public static final byte[] TAB
public DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec)
configuration
- the configurationbasePath
- the base pathcodec
- the codecpublic DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec, byte[] fieldDelimiter)
configuration
- the configurationbasePath
- the base pathcodec
- the codecfieldDelimiter
- the field delimiterpublic DelimitedTextFileReader(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec, Split inputSplit, byte[] fieldDelimiter, byte[] textDelimiter)
configuration
- the configurationbasePath
- the base pathcodec
- the codecinputSplit
- the input splitfieldDelimiter
- the field delimitertextDelimiter
- the text delimiterpublic java.util.List<java.lang.String> read() throws java.io.IOException
DataReader
read
in interface DataReader<java.util.List<java.lang.String>>
null
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException