public class CSVOutputWriter extends FileOutputWriter<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
fieldDelimiter |
protected static java.lang.String |
lineDelimiter |
protected static java.lang.String |
tabDelimiter |
fs, openStreams, outPath, pw, writeMode
Constructor and Description |
---|
CSVOutputWriter(FileSystem.WriteMode writeMode,
Path outPath) |
CSVOutputWriter(FileSystem.WriteMode writeMode,
Path outPath,
Config cfg) |
CSVOutputWriter(FileSystem.WriteMode writeMode,
Path outPath,
java.lang.String linedelimiter,
java.lang.String fielddelimiter,
java.lang.String tabdelimiter,
Config cfg,
java.lang.String charsetName) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the writer, flush everything
|
void |
createOutput() |
void |
createOutput(int partition,
FSDataOutputStream out)
Create a suitable output
|
boolean |
isAllowedNullValues() |
boolean |
isQuoteStrings() |
void |
setAllowedNullValues(boolean allowedNullValues) |
void |
setCharsetName(java.lang.String charsetName) |
void |
setHeaders(java.lang.String[] headerNames) |
void |
setQuoteStrings(boolean quoteStrings) |
void |
writeRecord(int partition,
java.lang.String data)
Write the record to output
|
void |
writeRecord(java.lang.String data) |
configure, generateRandom, getWriteMode, setWriteMode, write, write
protected static java.lang.String lineDelimiter
protected static java.lang.String fieldDelimiter
protected static java.lang.String tabDelimiter
public CSVOutputWriter(FileSystem.WriteMode writeMode, Path outPath)
public CSVOutputWriter(FileSystem.WriteMode writeMode, Path outPath, Config cfg)
public CSVOutputWriter(FileSystem.WriteMode writeMode, Path outPath, java.lang.String linedelimiter, java.lang.String fielddelimiter, java.lang.String tabdelimiter, Config cfg, java.lang.String charsetName)
public boolean isAllowedNullValues()
public void setAllowedNullValues(boolean allowedNullValues)
public boolean isQuoteStrings()
public void setQuoteStrings(boolean quoteStrings)
public void setCharsetName(java.lang.String charsetName)
public void createOutput(int partition, FSDataOutputStream out)
FileOutputWriter
createOutput
in class FileOutputWriter<java.lang.String>
partition
- partition idout
- the out streampublic void setHeaders(java.lang.String[] headerNames)
public void writeRecord(int partition, java.lang.String data)
FileOutputWriter
writeRecord
in class FileOutputWriter<java.lang.String>
partition
- partition iddata
- datapublic void createOutput()
public void writeRecord(java.lang.String data)
writeRecord
in class FileOutputWriter<java.lang.String>
public void close()
OutputWriter
close
in interface OutputWriter<java.lang.String>
close
in class FileOutputWriter<java.lang.String>