[ 
https://issues.apache.org/jira/browse/FLINK-1996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15269019#comment-15269019
 ] 

ASF GitHub Bot commented on FLINK-1996:
---------------------------------------

Github user fhueske commented on the pull request:

    https://github.com/apache/flink/pull/1961#issuecomment-216588444
  
    Thanks for the feedback @yjshen. 
    
    The motivation of the `TableSink` interface is to support very different 
storage systems (JDBC, Cassandra, Kafka, HBase, ...) and formats (CSV, Parquet, 
Avro, etc.). The idea is to reuse existing OutputFormats (DataSet) and 
SinkFunctions (DataStream) as much as possible. The configuration of the 
`TableSink` with field names and types happens internally and is not 
user-facing. 
    
    While the goal is to support many different systems, we do not want to blow 
up the the dependencies of the flink-table module. With the current design we 
can add TableSinks to the respective modules in `flink-batch-connectors` and 
`flink-streaming-connectors` and don't have to add all external dependencies to 
the Table API. Also we want to give users the option to define their own table 
sinks.
    
    I am not sure about configuring the output type and parameters with untyped 
Strings. IMO, this makes it hard to identify and look up relevant parameters 
and options. 
    But maybe we can add a registration of TableSinks to the TableEnvironment 
and do something like:
    
    ```
    tEnv.registerSinkType("csv", classOf[CsvTableSink])
    
    val t: Table = ...
    t.toSink("csv").option("path", "/foo").option("fileDelim", "|")
    ```
    We would need to find a way to pass the options to the TableSink 
constructor, maybe via reflection... 


> Add output methods to Table API
> -------------------------------
>
>                 Key: FLINK-1996
>                 URL: https://issues.apache.org/jira/browse/FLINK-1996
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API
>    Affects Versions: 0.9
>            Reporter: Fabian Hueske
>            Assignee: Fabian Hueske
>
> Tables need to be converted to DataSets (or DataStreams) to write them out. 
> It would be good to have a way to emit Table results directly for example to 
> print, CSV, JDBC, HBase, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to