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

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

fhueske commented on a change in pull request #6456: [FLINK-9947] [docs] 
Document unified table sources/sinks/formats
URL: https://github.com/apache/flink/pull/6456#discussion_r206540657
 
 

 ##########
 File path: docs/dev/table/connect.md
 ##########
 @@ -0,0 +1,1033 @@
+---
+title: "Connect to External Systems"
+nav-parent_id: tableapi
+nav-pos: 19
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+Flink's Table API & SQL programs can be connected to other external systems 
for reading and writing both batch and streaming tables. A table source 
provides access to data which is stored in external systems (such as a 
database, key-value store, message queue, or file system). A table sink emits a 
table to an external storage system. Depending on the type of source and sink, 
they support different formats such as CSV, Parquet, or ORC.
+
+This page describes how to declare built-in table sources and/or table sinks 
and register them in Flink. After a source, sink, or both have been registered, 
they can be accessed by Table API & SQL queries.
+
+<span class="label label-danger">Attention</span> If you want to implement 
your own *custom* table source or sink, have a look at the [user-defined 
sources & sinks page](sourceSinks.html).
+
+* This will be replaced by the TOC
+{:toc}
+
+Dependencies
+------------
+
+The following table list all available connectors and formats. Their mutual 
compatibility is tagged in the corresponding sections for [table 
connectors](connect.html#table-connectors) and [table 
formats](connect.html#table-formats). The following table provides dependency 
information for both projects using a build automation tool (such as Maven or 
SBT) and SQL Client with SQL JAR bundles.
+
+{% if site.is_stable %}
+
+### Connectors
+
+| Name              | Version       | Maven dependency             | SQL 
Client JAR         |
+| :---------------- | :------------ | :--------------------------- | 
:----------------------|
+| Filesystem        |               | Built-in                     | Built-in  
             |
+| Apache Kafka      | 0.8           | `flink-connector-kafka-0.8`  | Not 
available          |
+| Apache Kafka      | 0.9           | `flink-connector-kafka-0.9`  | 
[Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-kafka-0.9{{site.scala_version_suffix}}/{{site.version}}/flink-connector-kafka-0.9{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar)
 |
+| Apache Kafka      | 0.10          | `flink-connector-kafka-0.10` | 
[Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-kafka-0.10{{site.scala_version_suffix}}/{{site.version}}/flink-connector-kafka-0.10{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar)
 |
+| Apache Kafka      | 0.11          | `flink-connector-kafka-0.11` | 
[Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-kafka-0.11{{site.scala_version_suffix}}/{{site.version}}/flink-connector-kafka-0.11{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar)
 |
+
+### Formats
+
+| Name              | Maven dependency             | SQL Client JAR         |
+| :---------------- | :--------------------------- | :--------------------- |
+| CSV               | Built-in                     | Built-in               |
+| JSON              | `flink-json`                 | 
[Download](http://central.maven.org/maven2/org/apache/flink/flink-json/{{site.version}}/flink-json-{{site.version}}-sql-jar.jar)
 |
+| Apache Avro       | `flink-avro`                 | 
[Download](http://central.maven.org/maven2/org/apache/flink/flink-avro/{{site.version}}/flink-avro-{{site.version}}-sql-jar.jar)
 |
+
+{% else %}
+
+This table is only available for stable releases.
+
+{% endif %}
+
+{% top %}
+
+Overview
+--------
+
+Beginning from Flink 1.6, the declaration of a connection to an external 
system is separated from the actual implementation. Connections can be 
specified either
+
+- **programmatically** using a `Descriptor` under 
`org.apache.flink.table.descriptors` for Table & SQL API
+- or **declaratively** via [YAML configuration files](http://yaml.org/) for 
the SQL Client.
+
+This allows not only for better unification of APIs and SQL Client but also 
for better extensibility in case of [custom implementations](sourceSinks.html) 
without changing the declaration.
+
+Similar to a SQL `CREATE TABLE` statement, one can define the name of the 
table, the final schema of the table, connector, and a data format upfront for 
connecting to an external system. Additionally, the table's type (source, sink, 
or both) and an update mode for streaming queries can be specified:
+
+<div class="codetabs" markdown="1">
+<div data-lang="Java/Scala" markdown="1">
+{% highlight java %}
+tableEnvironment
+  .connect(...)
+  .withFormat(...)
+  .withSchema(...)
+  .inAppendMode()
+  .registerTableSource(...)
+{% endhighlight %}
+</div>
+
+<div data-lang="YAML" markdown="1">
+{% highlight yaml %}
+name: MyTable
+type: source
+update-mode: append
+schema: ...
+format: ...
+connector: ...
+{% endhighlight %}
+</div>
+</div>
+
+The subsequent sections will cover each definition part 
([schema](connect.html#table-schema), 
[connector](connect.html#table-connectors), 
[format](connect.html#table-formats), and [update 
mode](connect.html#update-modes)) in more detail.
 
 Review comment:
   I think it would be good to explain the overall responsibilities and 
dependencies of the descriptors before describing them in detail.
   
   * Connector: defines all properties to connect to a data store as source or 
sink
   * Format: defines the format of the data in the storage system. Can be CSV, 
Avro, Parquet but also the schema of a database table.
   * TableSchema: defines the schema of a table as it is exposed to SQL 
queries. Table schema fields can be linked to format fields or derived such as 
time attributes. 

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


> Document unified table sources/sinks/formats
> --------------------------------------------
>
>                 Key: FLINK-9947
>                 URL: https://issues.apache.org/jira/browse/FLINK-9947
>             Project: Flink
>          Issue Type: Improvement
>          Components: Documentation, Table API &amp; SQL
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>            Priority: Major
>              Labels: pull-request-available
>
> The recent unification of table sources/sinks/formats needs documentation. I 
> propose a new page that explains the built-in sources, sinks, and formats as 
> well as a page for customization of public interfaces.



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

Reply via email to