public class DelimitedTextFileWriter extends Object implements DataStoreWriter<List<String>>
DelimitedTextFileWriter is a DataStoreWriter implementation
able to write Strings into 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 |
|---|
DelimitedTextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec)
Instantiates a new delimited text file writer.
|
DelimitedTextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec,
byte[] fieldDelimiter)
Instantiates a new delimited text file writer.
|
DelimitedTextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec,
byte[] fieldDelimiter,
byte[] textDelimiter)
Instantiates a new delimited text file writer.
|
public static final byte[] CSV
public static final byte[] TAB
public DelimitedTextFileWriter(Configuration configuration, Path basePath, CodecInfo codec)
configuration - the configurationbasePath - the base pathcodec - the codecpublic DelimitedTextFileWriter(Configuration configuration, Path basePath, CodecInfo codec, byte[] fieldDelimiter)
configuration - the configurationbasePath - the base pathcodec - the codecfieldDelimiter - the field delimiterpublic DelimitedTextFileWriter(Configuration configuration, Path basePath, CodecInfo codec, byte[] fieldDelimiter, byte[] textDelimiter)
configuration - the configurationbasePath - the base pathcodec - the codecfieldDelimiter - the field delimitertextDelimiter - the text delimiterpublic void write(List<String> entity) throws IOException
DataWriterwrite in interface DataWriter<List<String>>IOException - if an I/O error occurspublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException