XBaith commented on a change in pull request #11961:
URL: https://github.com/apache/flink/pull/11961#discussion_r420271571
##########
File path: docs/dev/table/sqlClient.zh.md
##########
@@ -23,72 +23,71 @@ specific language governing permissions and limitations
under the License.
-->
+Flink 的 Table & SQL API 可以处理 SQL 语言编写的查询语句,但是这些查询需要嵌入用 Java 或 Scala
编写的表程序中。此外,这些程序在提交给集群前需要用构建工具打包。这或多或少限制了 Java/Scala 程序员对 Flink 的使用。
-Flink’s Table & SQL API makes it possible to work with queries written in the
SQL language, but these queries need to be embedded within a table program that
is written in either Java or Scala. Moreover, these programs need to be
packaged with a build tool before being submitted to a cluster. This more or
less limits the usage of Flink to Java/Scala programmers.
-
-The *SQL Client* aims to provide an easy way of writing, debugging, and
submitting table programs to a Flink cluster without a single line of Java or
Scala code. The *SQL Client CLI* allows for retrieving and visualizing
real-time results from the running distributed application on the command line.
+*SQL 客户端* 的目的是提供一种简单的方式来编写、调试和提交表程序到 Flink 集群上,而无需用一行 Java 或 Scala 代码。*SQL
客户端命令行界面(CLI)* 能够在命令行中检索和可视化分布式应用中实时产生的结果。
<a href="{{ site.baseurl }}/fig/sql_client_demo.gif"><img class="offset"
src="{{ site.baseurl }}/fig/sql_client_demo.gif" alt="Animated demo of the
Flink SQL Client CLI running table programs on a cluster" width="80%" /></a>
-<span class="label label-danger">Attention</span> The SQL Client is in an
early development phase. Even though the application is not production-ready
yet, it can be a quite useful tool for prototyping and playing around with
Flink SQL. In the future, the community plans to extend its functionality by
providing a REST-based [SQL Client Gateway](sqlClient.html#limitations--future).
+<span class="label label-danger">注意</span> SQL
客户端正处于早期开发阶段。虽然还尚未投入生产,但是它对于原型设计和玩转 Flink SQL 还是很实用的工具。将来,社区计划通过提供基于 REST 的[SQL
客户端网关(Gateway)](sqlClient.html#limitations--future)的来扩展它的功能。
* This will be replaced by the TOC
{:toc}
-Getting Started
+入门
---------------
-This section describes how to setup and run your first Flink SQL program from
the command-line.
+本节介绍如何在命令行里设置(setup)和运行你的第一个 Flink SQL 程序。
-The SQL Client is bundled in the regular Flink distribution and thus runnable
out-of-the-box. It requires only a running Flink cluster where table programs
can be executed. For more information about setting up a Flink cluster see the
[Cluster & Deployment]({{ site.baseurl }}/ops/deployment/cluster_setup.html)
part. If you simply want to try out the SQL Client, you can also start a local
cluster with one worker using the following command:
+SQL 客户端捆绑在常规 Flink 发行版中,因此可以直接运行。它仅需要一个正在运行的 Flink 集群就可以在其中执行表程序。有关设置 Flink
群集的更多信息,请参见[集群和部署]({{ site.baseurl
}}/zh/ops/deployment/cluster_setup.html)部分。如果仅想试用 SQL 客户端,也可以使用以下命令启动本地集群:
{% highlight bash %}
./bin/start-cluster.sh
{% endhighlight %}
-### Starting the SQL Client CLI
+### 启动 SQL 客户端命令行界面
-The SQL Client scripts are also located in the binary directory of Flink. [In
the future](sqlClient.html#limitations--future), a user will have two
possibilities of starting the SQL Client CLI either by starting an embedded
standalone process or by connecting to a remote SQL Client Gateway. At the
moment only the `embedded` mode is supported. You can start the CLI by calling:
+SQL Client 脚本也位于 Flink
的二进制目录中。[将来](sqlClient.html#limitations--future),用户可以通过启动嵌入式 standalone
进程或通过连接到远程 SQL 客户端网关来启动 SQL 客户端命令行界面。目前仅 `embedded` 支持该模式。您可以通过以下方式启动CLI:
{% highlight bash %}
./bin/sql-client.sh embedded
{% endhighlight %}
-By default, the SQL Client will read its configuration from the environment
file located in `./conf/sql-client-defaults.yaml`. See the [configuration
part](sqlClient.html#environment-files) for more information about the
structure of environment files.
+默认情况下,SQL 客户端将从 `./conf/sql-client-defaults.yaml`
中读取其配置。有关环境配置文件结构的更多信息,请参见[配置部分](sqlClient.html#environment-files)。
-### Running SQL Queries
+### 执行 SQL 查询
-Once the CLI has been started, you can use the `HELP` command to list all
available SQL statements. For validating your setup and cluster connection, you
can enter your first SQL query and press the `Enter` key to execute it:
+命令行界面启动后,你可以使用 `HELP` 命令列出所有可用的 SQL 语句。输入第一条 SQL 查询语句并按 `Enter`
键执行,可以验证你的设置及集群连接是否正确:
{% highlight sql %}
SELECT 'Hello World';
{% endhighlight %}
-This query requires no table source and produces a single row result. The CLI
will retrieve results from the cluster and visualize them. You can close the
result view by pressing the `Q` key.
+该查询不需要 table source,并且只产生一行结果。CLI 将从集群中检索结果并将其可视化。按 `Q` 键退出结果视图。
-The CLI supports **two modes** for maintaining and visualizing results.
+CLI 为维护和可视化结果提供**两种模式**。
-The **table mode** materializes results in memory and visualizes them in a
regular, paginated table representation. It can be enabled by executing the
following command in the CLI:
+**表格模式**(table mode)在内存中实体化结果,并将结果用规则的分页表格可视化展示出来。执行如下命令启用:
Review comment:
有想过“实例化结果”,但是我也不是很确定有没有更好的翻译,只得暂时用“实体化结果”。:(
----------------------------------------------------------------
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]