[
https://issues.apache.org/jira/browse/FLINK-10071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570349#comment-16570349
]
ASF GitHub Bot commented on FLINK-10071:
----------------------------------------
fhueske commented on a change in pull request #6505: [FLINK-10071] [docs]
Document usage of INSERT INTO in SQL Client
URL: https://github.com/apache/flink/pull/6505#discussion_r207929875
##########
File path: docs/dev/table/sqlClient.md
##########
@@ -369,6 +371,62 @@ This process can be recursively performed until all the
constructor parameters a
{% top %}
+Long-running SQL Queries
+------------------------
+
+In order to define end-to-end SQL pipelines, SQL's `INSERT INTO` statement can
be used for submitting long-running queries to a Flink cluster.
+
+{% highlight sql %}
+INSERT INTO MyTableSink SELECT * FROM MyTableSource
+{% endhighlight %}
+
+The table sink `MyTableSink` has to be declared in the environment file. See
the [connection page](connect.html) for more information about supported table
sinks and their configuration. An example for an Apache Kafka table sink is
shown below.
+
+{% highlight yaml %}
+tables:
+ - name: MyTableSink
+ type: sink
+ update-mode: append
+ connector:
+ property-version: 1
+ type: kafka
+ version: 0.11
+ topic: OutputTopic
+ properties:
+ - key: zookeeper.connect
+ value: localhost:2181
+ - key: bootstrap.servers
+ value: localhost:9092
+ - key: group.id
+ value: testGroup
+ format:
+ property-version: 1
+ type: json
+ derive-schema: true
+ schema:
+ - name: rideId
+ type: LONG
+ - name: lon
+ type: FLOAT
+ - name: lat
+ type: FLOAT
+ - name: rideTime
+ type: TIMESTAMP
+{% endhighlight %}
+
+The SQL Client makes sure that a statement is successfully submitted to the
cluster. Once the query is submitted, the CLI will show information about the
Flink job.
+
+{% highlight text %}
+[INFO] Table update statement has been successfully submitted to the cluster:
+Cluster ID: StandaloneClusterId
+Job ID: 6f922fe5cba87406ff23ae4a7bb79044
+Web interface: http://localhost:8081
+{% endhighlight %}
+
+<span class="label label-danger">Attention</span> The SQL Client does not
track the status of the running Flink job after submission. The CLI process can
be shutdown after the submission without affecting the long-running query.
Flink's [restart strategy]({{ site.baseurl }}/dev/restart_strategies.html)
takes care of the fault-tolerance.
Review comment:
We should add that a query can be canceled using the WebUI or via REST
----------------------------------------------------------------
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:
[email protected]
> Document usage of INSERT INTO in SQL Client
> -------------------------------------------
>
> Key: FLINK-10071
> URL: https://issues.apache.org/jira/browse/FLINK-10071
> Project: Flink
> Issue Type: Sub-task
> Components: Documentation, Table API & SQL
> Reporter: Timo Walther
> Assignee: Timo Walther
> Priority: Major
> Labels: pull-request-available
>
> Document the usage of {{INSERT INTO}} statements in SQL.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)