You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/05 08:51:26 UTC

[GitHub] [flink] slinkydeveloper commented on a change in pull request #18055: [docs] Tutorial: Write Your First Flink SQL program

slinkydeveloper commented on a change in pull request #18055:
URL: https://github.com/apache/flink/pull/18055#discussion_r778641188



##########
File path: docs/content/docs/try-flink/write_flink_program_with_sql.md
##########
@@ -0,0 +1,262 @@
+---
+title: 'Write your first Flink program with SQL'
+weight: 2 
+type: docs
+aliases:
+  - /try-flink/write_flink_program_with_sql.html
+---
+<!--
+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.
+-->
+
+# Write your first Flink program with SQL
+
+## Introduction
+
+Flink features [multiple APIs]({{< ref "docs/concepts/overview" >}}) with different levels of abstraction that can be used to develop your streaming application. SQL is the highest level of abstraction and is supported by Flink as a relational API for batch and stream processing. This means that you can write the same queries on both unbounded real-time streams and bounded recorded streams and produce the same results. 
+
+SQL on Flink is based on [Apache Calcite](https://calcite.apache.org/) (which is based on standard SQL) and is commonly used to ease the process of implementing data analytics, data pipelining, and ETL applications.  It is a great entryway to writing your first Flink application and requires no Java or Python. 
+
+This tutorial will guide you through writing your first Flink program leveraging SQL alone. Through this exercise you will learn and understand the ease and speed with which you can analyze streaming data in Flink! 
+
+
+## Goals
+
+This tutorial will teach you how to:
+
+- use the Flink SQL client to submit queries 
+- consume a data source with Flink SQL
+- run a continuous query on a stream of data
+- use Flink SQL to write out results to persistent storage 
+
+
+## Prerequisites 
+
+You only need to have basic knowledge of SQL to follow along.
+
+
+## Step 1: Start the Flink SQL client 
+
+The [SQL Client]({{< ref "docs/dev/table/sqlClient" >}}) is bundled in the regular Flink distribution and can be run out-of-the-box. It requires only a running Flink cluster where table programs can be executed (since Flink SQL is a thin abstraction over the Table API). 
+
+There are many ways to set up Flink but you will run it locally for the purpose of this tutorial. [Download Flink]({{< ref "docs/try-flink/local_installation#downloading-flink" >}}) and [start a local cluster]({{< ref "docs/try-flink/local_installation#starting-and-stopping-a-local-cluster" >}}) with one worker (the TaskManager).  
+
+The scripts for the SQL client are located in the `/bin` directory of Flink. You can start the client by executing:
+
+```sh
+./bin/sql-client.sh
+```
+
+You should see something like this:
+
+{{< img src="/fig/try-flink/flink-sql.png" alt="Flink SQL client" >}}
+
+
+## Step 2: Set up a data source with flink-faker

Review comment:
       I think even a simple file committed here is enough, something like a single csv file or 1000 lines 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org