public class CsvTableSink extends Object implements TableSinkBase<Row>, BatchTableSink<Row>, AppendStreamTableSink<Row>
TableSink
to emit data as CSV files.
param: path The output path to write the Table to. param: fieldDelim The field delimiter param: numFiles The number of files to write to param: writeMode The write mode to specify whether existing files are overwritten or not.
Constructor and Description |
---|
CsvTableSink(String path,
scala.Option<String> fieldDelim,
scala.Option<Object> numFiles,
scala.Option<FileSystem.WriteMode> writeMode) |
CsvTableSink(String path,
String fieldDelim)
A simple
TableSink to emit data as CSV files. |
CsvTableSink(String path,
String fieldDelim,
int numFiles,
FileSystem.WriteMode writeMode)
A simple
TableSink to emit data as CSV files. |
Modifier and Type | Method and Description |
---|---|
static TableSink<T> |
configure(String[] fieldNames,
TypeInformation<?>[] fieldTypes) |
protected TableSinkBase<Row> |
copy()
Return a deep copy of the
TableSink . |
void |
emitDataSet(DataSet<Row> dataSet)
Emits the DataSet.
|
void |
emitDataStream(DataStream<Row> dataStream)
Emits the DataStream.
|
static String[] |
getFieldNames() |
static TypeInformation<?>[] |
getFieldTypes() |
TypeInformation<Row> |
getOutputType()
Return the type expected by this
TableSink . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, fieldNames, fieldTypes, getFieldNames, getFieldTypes
public CsvTableSink(String path, scala.Option<String> fieldDelim, scala.Option<Object> numFiles, scala.Option<FileSystem.WriteMode> writeMode)
public CsvTableSink(String path, String fieldDelim)
TableSink
to emit data as CSV files.
path
- The output path to write the Table to.fieldDelim
- The field delimiter, ',' by default.public CsvTableSink(String path, String fieldDelim, int numFiles, FileSystem.WriteMode writeMode)
TableSink
to emit data as CSV files.
path
- The output path to write the Table to.fieldDelim
- The field delimiter.numFiles
- The number of files to write to.writeMode
- The write mode to specify whether existing files are overwritten or not.public static String[] getFieldNames()
public static TypeInformation<?>[] getFieldTypes()
public static final TableSink<T> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes)
public void emitDataSet(DataSet<Row> dataSet)
BatchTableSink
emitDataSet
in interface BatchTableSink<Row>
public void emitDataStream(DataStream<Row> dataStream)
AppendStreamTableSink
emitDataStream
in interface AppendStreamTableSink<Row>
protected TableSinkBase<Row> copy()
TableSinkBase
TableSink
.copy
in interface TableSinkBase<Row>
public TypeInformation<Row> getOutputType()
TableSink
TableSink
.
This type should depend on the types returned by getFieldNames
.
getOutputType
in interface TableSink<Row>
TableSink
.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.