You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/07/10 06:02:43 UTC

[GitHub] [flink] twalthr commented on a change in pull request #9054: [FLINK-13183][Table]Add a PrintTableSink

twalthr commented on a change in pull request #9054: [FLINK-13183][Table]Add a PrintTableSink
URL: https://github.com/apache/flink/pull/9054#discussion_r301897269
 
 

 ##########
 File path: flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/sinks/PrintTableSink.java
 ##########
 @@ -0,0 +1,63 @@
+package org.apache.flink.table.sinks;
+
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.typeutils.RowTypeInfo;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.streaming.api.datastream.DataStreamSink;
+import org.apache.flink.streaming.api.functions.sink.PrintSinkFunction;
+import org.apache.flink.table.utils.TableConnectorUtils;
+
+/**
+ * A simple {@link TableSink} to emit data to the standard output stream.
+ */
+public class PrintTableSink implements BatchTableSink , AppendStreamTableSink {
+
+	private String[] fieldNames;
+	private TypeInformation<?>[] fieldTypes;
+
+	@Override
+	public void emitDataSet(DataSet dataSet) {
+		try {
+			dataSet.print();
 
 Review comment:
   This triggers an execution immediately. And does not only add a sink.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services