You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2018/08/15 21:22:00 UTC

[jira] [Created] (FLINK-10156) Drop the Table.writeToSink() method

Fabian Hueske created FLINK-10156:
-------------------------------------

             Summary: Drop the Table.writeToSink() method
                 Key: FLINK-10156
                 URL: https://issues.apache.org/jira/browse/FLINK-10156
             Project: Flink
          Issue Type: Improvement
          Components: Table API &amp; SQL
            Reporter: Fabian Hueske


I am proposing to drop the {{Table.writeToSink()}} method.
 
*What is the method doing?*
The {{Table.writeToSink(TableSink)}} method emits a {{Table}} via a {{TableSink}}, for example to a Kafka topic, a file, or a database.
 
*Why should it be removed?*
The {{writeToSink()}} method was introduced before the Table API supported the {{Table.insertInto(String)}} method. The {{insertInto()}} method writes a table into a table that was previously registered with a {{TableSink}} in the catalog. It is the inverse method to the {{scan()}} method and the equivalent to an {{INSERT INTO ... SELECT}} SQL query.
 
I think we should remove {{writeToSink()}} for the following reasons:
1. It offers the same functionality as {{insertInto()}}. Removing it would reduce duplicated API.
2. {{writeToSink()}} requires a {{TableSink}} instance. I think TableSinks (and TableSources) should only be registered with the {{TableEnvironment}} and not be exposed to the "query part" of the Table API / SQL.
3. Registering tables in a catalog and using them for input and output is more aligned with SQL.
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)