aalexandrov commented on a change in pull request #13770: URL: https://github.com/apache/flink/pull/13770#discussion_r517312314
########## File path: docs/dev/table/connectors/kinesis.md ########## @@ -0,0 +1,334 @@ +--- +title: "Amazon Kinesis Data Streams SQL Connector" +nav-title: Kinesis +nav-parent_id: sql-connectors +nav-pos: 2 +--- +<!-- +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. +--> + +<span class="label label-primary">Scan Source: Unbounded</span> +<span class="label label-primary">Sink: Streaming Append Mode</span> + +* This will be replaced by the TOC +{:toc} + +The Kinesis connector allows for reading data from and writing data into [Amazon Kinesis Data Streams (KDS)](https://aws.amazon.com/kinesis/data-streams/). + +Dependencies +------------ + +To use the connector, add the following Maven dependency to your project: + +{% highlight xml %} +<dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-connector-kinesis{{ site.scala_version_suffix }}</artifactId> + <version>{{site.version }}</version> +</dependency> +{% endhighlight %} + +How to create a Kinesis data stream table +----------------------------------------- + +Follow the instructions from the [Amazon KDS Developer Guide](https://docs.aws.amazon.com/streams/latest/dev/learning-kinesis-module-one-create-stream.html) to set up a Kinesis stream. +The following example shows how to create a table backed by a Kinesis data stream: + +<div class="codetabs" markdown="1"> +<div data-lang="SQL" markdown="1"> +{% highlight sql %} +CREATE TABLE KinesisTable ( + user_id BIGINT, + item_id BIGINT, + category_id BIGINT, + behavior STRING, + ts TIMESTAMP(3) +) PARTITIONED BY (user_id, item_id) WITH ( + 'connector' = 'kinesis', + 'stream' = 'user_behavior', + 'properties.aws.region' = 'us-east-2', + 'properties.flink.stream.initpos' = 'LATEST', + 'format' = 'csv' +) +{% endhighlight %} +</div> +</div> + +Available Metadata +------------------ + +The following metadata can be exposed as read-only (`VIRTUAL`) columns in a table definition. + +<table class="table table-bordered"> + <thead> + <tr> + <th class="text-left" style="width: 25%">Column Name</th> + <th class="text-center" style="width: 45%">Column Type</th> + <th class="text-center" style="width: 35%">Description</th> + </tr> + </thead> + <tbody> + <tr> + <td><code><a href="https://docs.aws.amazon.com/kinesis/latest/APIReference/API_Record.html#Streams-Type-Record-ApproximateArrivalTimestamp">ApproximateArrivalTimestamp</a></code></td> + <td><code>TIMESTAMP(3) WITH LOCAL TIMEZONE NOT NULL</code></td> + <td>The approximate time that the record was inserted into the stream.</td> Review comment: Done. ---------------------------------------------------------------- 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: [email protected]
