浏览代码

Merge pull request #344 from rnhx/docs/translate

Docs/translate
jinfahua 4 年之前
父节点
当前提交
a4c8dddde9
共有 46 个文件被更改,包括 674 次插入654 次删除
  1. 3 3
      docs/zh_CN/cli/overview.md
  2. 29 28
      docs/zh_CN/cli/plugins.md
  3. 6 6
      docs/zh_CN/cli/rules.md
  4. 8 9
      docs/zh_CN/cli/streams.md
  5. 22 21
      docs/zh_CN/extension/function.md
  6. 7 7
      docs/zh_CN/extension/overview.md
  7. 25 23
      docs/zh_CN/extension/sink.md
  8. 38 38
      docs/zh_CN/extension/source.md
  9. 16 15
      docs/zh_CN/json_expr.md
  10. 9 9
      docs/zh_CN/operation/configuration_file.md
  11. 5 5
      docs/zh_CN/operation/install/cent-os.md
  12. 12 12
      docs/zh_CN/operation/install/overview.md
  13. 3 3
      docs/zh_CN/operation/operations.md
  14. 1 1
      docs/zh_CN/operation/overview.md
  15. 3 3
      docs/zh_CN/plugins/overview.md
  16. 15 13
      docs/zh_CN/plugins/plugins_tutorial.md
  17. 11 11
      docs/zh_CN/plugins/sinks/file.md
  18. 14 14
      docs/zh_CN/plugins/sinks/influxdb.md
  19. 9 9
      docs/zh_CN/plugins/sinks/zmq.md
  20. 16 16
      docs/zh_CN/plugins/sources/random.md
  21. 13 13
      docs/zh_CN/plugins/sources/zmq.md
  22. 8 8
      docs/zh_CN/quick_start_docker.md
  23. 4 4
      docs/zh_CN/reference.md
  24. 5 5
      docs/zh_CN/restapi/overview.md
  25. 27 24
      docs/zh_CN/restapi/plugins.md
  26. 25 24
      docs/zh_CN/restapi/rules.md
  27. 14 14
      docs/zh_CN/restapi/streams.md
  28. 30 30
      docs/zh_CN/rules/overview.md
  29. 27 27
      docs/zh_CN/rules/sinks/edgex.md
  30. 1 1
      docs/zh_CN/rules/sinks/logs.md
  31. 11 11
      docs/zh_CN/rules/sinks/mqtt.md
  32. 3 3
      docs/zh_CN/rules/sinks/nop.md
  33. 11 10
      docs/zh_CN/rules/sinks/rest.md
  34. 22 22
      docs/zh_CN/rules/sources/edgex.md
  35. 26 26
      docs/zh_CN/rules/sources/http_pull.md
  36. 14 14
      docs/zh_CN/rules/sources/mqtt.md
  37. 39 38
      docs/zh_CN/sqls/built-in_functions.md
  38. 30 10
      docs/zh_CN/sqls/data_types.md
  39. 3 3
      docs/zh_CN/sqls/json_expr.md
  40. 24 24
      docs/zh_CN/sqls/lexical_elements.md
  41. 1 1
      docs/zh_CN/sqls/overview.md
  42. 26 26
      docs/zh_CN/sqls/query_language_elements.md
  43. 27 15
      docs/zh_CN/sqls/streams.md
  44. 14 38
      docs/zh_CN/sqls/windows.md
  45. 16 16
      docs/zh_CN/streams.md
  46. 1 1
      docs/zh_CN/tutorial.md

+ 3 - 3
docs/zh_CN/cli/overview.md

@@ -1,8 +1,8 @@
-Kuiper CLI(命令行界面)工具提供流和规则管理。
+Kuiper CLI (命令行界面)工具提供流和规则管理。
 
-Kuiper CLI可以作为Kuiper服务器的客户端。 Kuiper服务器运行引擎执行流或规则查询,包括处理流或规则定义、管理规则状态和io。
+Kuiper CLI 可以作为 Kuiper 服务器的客户端。 Kuiper 服务器运行引擎执行流或规则查询,包括处理流或规则定义、管理规则状态和 io。
 
-*Kuiper CLI架构*
+*Kuiper CLI 架构*
 ![CLI Arch](resources/arch.png)
 
 - [流](streams.md)

+ 29 - 28
docs/zh_CN/cli/plugins.md

@@ -1,59 +1,59 @@
-# Plugins management
+# 插件管理
 
-The Kuiper plugin command line tools allows you to manage plugins, such as create, show and drop plugins. Notice that, drop a plugin will need to restart kuiper to take effect. To update a plugin, do the following:
-1. Drop the plugin.
-2. Restart Kuiper.
-3. Create the plugin with the new configuration.
+Kuiper 插件命令行工具使您可以管理插件,例如创建,显示和删除插件。 请注意,删除插件将需要重新启动kuiper 才能生效。 要更新插件,请执行以下操作:
+1. 删除插件。
+2. 重新启动 Kuiper。
+3. 使用新配置创建插件。
 
-## create a plugin
+## 创建插件
 
-The command is used for creating a plugin.  The plugin's definition is specified with JSON format.
+该命令用于创建插件。 插件的定义以 JSON 格式指定。
 
 ```shell
 create plugin $plugin_type $plugin_name $plugin_json | create plugin $plugin_type $plugin_name -f $plugin_def_file
 ```
 
-The plugin can be created with two ways. 
+插件可以通过两种方式创建。
 
-- Specify the plugin definition in command line.
+- 在命令行中指定插件定义。
 
-Sample:
+示例:
 
 ```shell
 # bin/cli create plugin source random {"file":"http://127.0.0.1/plugins/sources/random.zip"}
 ```
 
-The command create a source plugin named ``random``. 
+该命令创建一个名为 `random` 的源插件。
 
-- Specify the plugin definition in a file. If the plugin is complex, or the plugin is already wrote in text files with well organized formats, you can just specify the plugin definition through ``-f`` option.
+- 在文件中指定插件定义。 如果插件很复杂,或者插件已经以规范有序的格式写在文本文件中,则只需通过 `-f` 选项指定插件定义即可。
 
-Sample:
+示例:
 
 ```shell
 # bin/cli create plugin sink plugin1 -f /tmp/plugin1.txt
 ```
 
-Below is the contents of ``plugin1.txt``.
+以下是 `plugin1.txt` 的内容。
 
 ```json
 {
   "file":"http://127.0.0.1/plugins/sources/random.zip"
 }
 ```
-### parameters
-1. plugin_type: the type of the plugin. Available values are `["source", "sink", "functions"]`
-2. plugin_name: a unique name of the plugin. The name must be the same as the camel case version of the plugin with lowercase first letter. For example, if the exported plugin name is `Random`, then the name of this plugin is `random`.
-3. file: the url of the plugin files. It must be a zip file with: a compiled so file and the yaml file(only required for sources). The name of the files must match the name of the plugin. Please check [Extension](../extension/overview.md) for the naming rule.
+### 参数
+1. plugin_type:插件类型,可用值为 `["source", "sink", "functions"]`
+2. plugin_name:插件的唯一名称。名称首字母必须小写。例如,如果导出的插件名称为 `Random`,则此插件的名称为 `Random`。
+3. file:插件文件的网址。 它必须是一个 zip 文件,其中包含:编译后的 so 文件和 yaml 文件(仅源文件需要)。 文件名称必须与插件名称匹配。 关于命名规则,查看 [扩展名](../extension/overview.md) 。
 
-## show plugins
+## 显示插件
 
-The command is used for displaying all plugins defined in the server for a plugin type.
+该命令用于显示服务器中为插件类型定义的所有插件。
 
 ```shell
 show plugins function
 ```
 
-Sample:
+示例:
 
 ```shell
 # bin/cli show plugins function
@@ -61,14 +61,14 @@ function1
 function2
 ```
 
-## describe a plugin
-The command is used to print out the detailed definition of a plugin.
+## 描述插件
+该命令用于打印插件的详细定义。
 
 ```shell
 describe plugin $plugin_type $plugin_name
 ```
 
-Sample: 
+示例:
 
 ```shell
 # bin/cli describe plugin source plugin1
@@ -78,15 +78,16 @@ Sample:
 }
 ```
 
-## drop a plugin
+## 删除插件
 
-The command is used for drop the plugin.
+该命令用于删除插件。
 
 ```shell
 drop plugin $plugin_type $plugin_name -s $stop 
 ```
-In which, `-s $stop` is an optional boolean parameter. If it is set to true, the Kuiper server will be stopped for the delete to take effect. The user will need to restart it manually.
-Sample:
+其中,`-s $stop` 是可选的布尔参数。 如果将其设置为 true,则 Kuiper 服务器将停止,以使删除生效。 用户将需要手动重新启动它。
+
+示例:
 
 ```shell
 # bin/cli drop plugin source random

+ 6 - 6
docs/zh_CN/cli/rules.md

@@ -1,10 +1,10 @@
 # 规则管理
 
-Kuiper规则命令行工具可以管理规则,例如创建、显示、删除、描述、启动、停止和重新启动规则。
+Kuiper 规则命令行工具可以管理规则,例如创建、显示、删除、描述、启动、停止和重新启动规则。
 
 ## 创建规则
 
-如下命令用于创建规则。 规则的定义以JSON 格式指定,请阅读 [rule](../rules/overview.md) 以获取更多详细信息。
+如下命令用于创建规则。 规则的定义以 JSON 格式指定,请阅读 [rule](../rules/overview.md) 以获取更多详细信息。
 
 ```shell
 create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
@@ -20,9 +20,9 @@ create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
 # bin/cli create rule rule1 {"sql": "SELECT * from demo","actions": [{"log":  {}},{"mqtt":  {"server":"tcp://127.0.0.1:1883", "topic":"demoSink"}}]}
 ```
 
-该命令创建一个名为``rule1``的规则。
+该命令创建一个名为 `rule1` 的规则。
 
-- 在文件中明确规则定义。 如果规则很复杂,或者规则已经以组织良好的格式写在文本文件中,则只需通过-f选项指定规则定义即可。
+- 在文件中明确规则定义。 如果规则很复杂,或者规则已经以组织良好的格式写在文本文件中,则只需通过 `-f` 选项指定规则定义即可。
 
 示例:
 
@@ -30,7 +30,7 @@ create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
 # bin/cli create rule rule1 -f /tmp/rule.txt
 ```
 
-以下是`rule.txt`的内容。
+以下是 `rule.txt` 的内容。
 
 ```json
 {
@@ -51,7 +51,7 @@ create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
 
 ## 展示规则
 
-该命令用于显示服务器中定义的所有规则,包括规则id和当前状态。
+该命令用于显示服务器中定义的所有规则,包括规则 id 和当前状态。
 
 ```shell
 show rules

+ 8 - 9
docs/zh_CN/cli/streams.md

@@ -1,10 +1,10 @@
 # 流管理
 
-Kuiper流命令行工具可用于管理流,例如创建、描述、显示和删除流定义。
+Kuiper 流命令行工具可用于管理流,例如创建、描述、显示和删除流定义。
 
 ## 创建流
 
-该命令用于创建流。 有关流定义的更多详细信息,请参考[流](../sqls/streams.md)。
+该命令用于创建流。有关流定义的更多详细信息,请参考[流](../sqls/streams.md)。
 
 ```shell
 create stream $stream_name $stream_def | create stream -f $stream_def_file
@@ -19,9 +19,9 @@ create stream $stream_name $stream_def | create stream -f $stream_def_file
 stream my_stream created
 ```
 
-该命令创建一个名为``my_stream''的规则。
+该命令创建一个名为 `my_stream` 的规则。
 
-- 在文件中指定流定义。 如果流很复杂,或者流已经通过明确的格式写在文本文件中,则只需通过“-f”选项规定流定义。
+- 在文件中指定流定义。 如果流很复杂,或者流已经通过明确的格式写在文本文件中,则只需通过 `-f` 选项规定流定义。
 
 示例:
 
@@ -30,7 +30,7 @@ stream my_stream created
 stream my_stream created
 ```
 
-以下是my_stream.txt的内容。
+以下是`my_stream.txt`的内容。
 
 ```json
 my_stream(id bigint, name string, score float)
@@ -103,7 +103,7 @@ query
 kuiper > 
 ```
 
-键入query子命令后,它会提示``kuiper>”,然后在命令提示符中键入SQL(有关如何使用Kuiper SQL的信息,请参阅[Kuiper SQL 参考](../sqls/overview.md) ),然后按Enter
+键入 `query` 子命令后,它会提示 `kuiper>`,然后在命令提示符中键入 SQLs (有关如何使用Kuiper SQL的信息,请参阅 [Kuiper SQL 参考](../sqls/overview.md) ),然后按回车
 
 结果将在控制台中打印。
 
@@ -112,6 +112,5 @@ kuiper > SELECT * FROM my_stream WHERE id > 10;
 [{"...":"..." ....}]
 ...
 ```
-- 输入 ``CTRL + C``停止查询; 
-- 如果没有键入任何SQL,则可以键入quit或exit退出kuiper提示控制台。
-
+- 输入 `CTRL + C` 停止查询; 
+- 如果没有键入任何 SQL,则可以键入 `quit` 或 `exit` 退出 `kuiper` 提示控制台。

+ 22 - 21
docs/zh_CN/extension/function.md

@@ -1,59 +1,60 @@
-# Function Extension
+# 函数扩展
 
-In the Kuiper SQL syntax, [many built-in functions](../sqls/built-in_functions.md) are provided to server for various reusable business logic. However, the users still likely need various reusable business logic which are not covered by the built ins. The function extension is presented to customized the functions.
+在 Kuiper SQL 语法中,向服务器提供了[许多内置函数](../sqls/built-in_functions.md),用于各种可重用的业务逻辑。 但是,用户仍然可能需要其他未被内置插件覆盖的可重用的业务逻辑。 提供函数扩展是为了自定义函数。
 
-## Developing
+## 开发
 
-### Develop a customized function
+### 开发一个定制函数
 
-To develop a function for Kuiper is to implement [api.Function](../../../xstream/api/stream.go) interface and export it as a golang plugin.
+为 Kuiper 开发函数的过程,就是实现 [api.Function](../../../xstream/api/stream.go) 接口并将其导出为 golang 插件。
 
-Before starting the development, you must [setup the environment for golang plugin](overview.md#setup-the-plugin-developing-environment). 
+在开始开发之前,您必须为 [golang 插件设置环境](overview.md#setup-the-plugin-developing-environment)。
 
-To develop a function, the _Validate_ method is firstly to be implemented. This method will be called during SQL validation. In this method, a slice of [xsql.Expr](../../../xsql/ast.go) is passed as the parameter that contains the arguments for this function in the runtime. The developer can do a validation against it to check the argument count and type etc. If validation is successful, return nil. Otherwise, return an error object.
+为了开发函数,首先要实现 _Validate_ 方法。 在 SQL 验证期间将调用此方法。 在此方法中,将传递 [xsql.Expr](../../../xsql/ast.go) 的切片作为参数,该参数包含运行时该函数的参数。 开发人员可以对其进行验证,以检查参数计数和类型等。如果验证成功,则返回 nil。 否则,返回一个错误对象。
 
 ```go
 //The argument is a list of xsql.Expr
 Validate(args []interface{}) error
 ```
-There are 2 types of functions: aggregate function and common function. For aggregate function, if the argument is a column, the received value will always be a slice of the column values in a group. The extended function must distinguish the function type by implement _IsAggregate_ method.
+函数有2种类型:聚合函数和通用函数。 对于聚合函数,如果参数为列,则接收的值将始终是组中列值的一部分。 扩展函数必须通过实施 _IsAggregate_ 方法来区分函数类型。
 
 ```go
 //If this function is an aggregate function. Each parameter of an aggregate function will be a slice
 IsAggregate() bool
 ```
 
-The main task for a Function is to implement _exec_ method. The method will be leverage to calculate the result of the function in the SQL. The argument is a slice of the values for the function parameters. You can use them to do the calculation. If the calculation is successful, return the result and true; otherwise, return nil and false. 
+函数的主任务是实现 _exec_ 方法。 该方法将用于计算 SQL 中函数的结果。 参数是函数参数值的一部分。 您可以使用它们进行计算。 如果计算成功,则返回结果并返回 true; 否则,返回 nil 和 false。
 
 ```go
-//Execute the function, return the result and if execution is successful.If execution fails, return the error and false. 
+//执行函数,如果执行成功,返回结果,如果执行失败,返回错误和 false。
 Exec(args []interface{}) (interface{}, bool)
-```  
+```
 
-As the function itself is a plugin, it must be in the main package. Given the function struct name is myFunction. At last of the file, the source must be exported as a symbol as below. There are [2 types of exported symbol supported](overview.md#plugin-development). For function extension, if there is no internal state, it is recommended to export a singleton instance.
+由于该函数本身是一个插件,因此必须位于 main 程序包中。 给定的函数结构名称为 myFunction。 在文件的最后,必须将源文件作为符号导出,如下所示。 有[2种类型的导出符号被支持](overview.md#plugin-development)。 对于函数扩展,如果没有内部状态,建议导出单例实例。
 
 ```go
 var MyFunction myFunction
 ```
 
-The [Echo Function](../../../plugins/functions/echo.go) is a good example.
+[Echo Function](../../../plugins/functions/echo.go) 是一个很好的示例。
 
-### Package the source
-Build the implemented function as a go plugin and make sure the output so file resides in the plugins/functions folder.
+### 源文件打包
+将实现的函数构建为 go 插件,并确保输出 so 文件位于 plugins/functions 文件夹中。
 
 ```bash
 go build --buildmode=plugin -o plugins/functions/MyFunction.so plugins/functions/my_function.go
 ```
 
-### Usage
+### 使用
+
+如果自定义函数遵循以下约定,则可以直接在规则的 SQL 中使用。
 
-The customized function can be directly used in the SQL of a rule if it follows the below convention.
+如果已经开发了函数实现 MyFunction,则应该具有:
 
-If you have developed a function implementation MyFunction, you should have:
-1. In the plugin file, symbol MyFunction is exported.
-2. The compiled MyFunction.so file is located inside _plugins/functions_
+1. 在插件文件中,将导出符号 MyFunction。
+2. 编译的 MyFunction.so 文件位于 _plugins/functions_ 内部
 
-To use it, just call it in the SQL inside a rule definition:
+要使用它,只需在规则定义中的 SQL 中调用它:
 ```json
 {
   "id": "rule1",

+ 7 - 7
docs/zh_CN/extension/overview.md

@@ -1,10 +1,10 @@
 # 扩展
 
-Kuiper允许用户自定义不同类型的扩展。 
+Kuiper 允许用户自定义不同类型的扩展。 
 
-- 源扩展用于扩展不同的流源,例如使用来自其他消息服务器的数据。 Kuiper对 [MQTT消息服务器](../rules/sources/mqtt.md)的内置源提供支持。
-- Sink / Action扩展用于将发布/推送数据扩展到不同的目标,例如数据库,其他消息系统,Web界面或文件系统。 Kuiper中提供内置动作支持,请参阅 [MQTT](../rules/sinks/mqtt.md) & [日志文件](../rules/sinks/logs.md).。
-- 函数扩展允许用户扩展SQL中使用的不同函数。 Kuiper支持内置函数,请参见 [functions](../sqls/built-in_functions.md)。
+- 源扩展用于扩展不同的流源,例如使用来自其他消息服务器的数据。Kuiper 对 [MQTT 消息服务器](../rules/sources/mqtt.md)的内置源提供支持。
+- Sink/Action 扩展用于将发布/推送数据扩展到不同的目标,例如数据库,其他消息系统,Web 界面或文件系统。Kuiper 中提供内置动作支持,请参阅  [MQTT](../rules/sinks/mqtt.md)  & [日志文件](../rules/sinks/logs.md).。
+- 函数扩展允许用户扩展 SQL 中使用的不同函数。 Kuiper支持内置函数,请参见 [functions](../sqls/built-in_functions.md)。
 
 请阅读以下内容,了解如何实现不同的扩展。
 
@@ -14,11 +14,11 @@ Kuiper允许用户自定义不同类型的扩展。
 
 ### 状态存储
 
-Kuiper扩展通过context参数暴露了一个基于键值对的状态存储接口,可用于所有类型的扩展,包括Source,Sink和Function扩展.
+Kuiper 扩展通过 context 参数暴露了一个基于键值对的状态存储接口,可用于所有类型的扩展,包括 Source,Sink  Function 扩展.
 
-状态为键值对,其中键为string类型而值为任意数据。键的作用域仅为当前扩展的实例。
+状态为键值对,其中键为 string 类型而值为任意数据。键的作用域仅为当前扩展的实例。
 
-用户可通过context对象访问状态存储。状态相关方法包括putState, getState, incrCounter, getCounter and deleteState。
+用户可通过 context 对象访问状态存储。状态相关方法包括 putState, getState, incrCounter, getCounter and deleteState。
 
 以下代码为函数扩展访问状态的实例。该函数将计算传入的单词数,并将累积数目保存在状态中。
 

+ 25 - 23
docs/zh_CN/extension/sink.md

@@ -1,41 +1,42 @@
-# Sink Extension
+# Sink (目标) 扩展
 
-Sink feed data from Kuiper into external systems. Kuiper has built-in sink support for [MQTT broker](../rules/sinks/mqtt.md) and [log sink](../rules/sinks/logs.md). There are still needs to publish data to various external systems include messaging systems and database etc. Sink extension is presented to meet this requirement.
+Kuiper 可以将数据接收到外部系统。 Kuiper具有对  [MQTT 消息服务器](../rules/sinks/mqtt.md) 和 [日志目标](../rules/sinks/logs.md)的内置接收器支持。然而, 仍然需要将数据发布到各种外部系统,包括消息传递系统和数据库等。Sink (目标)扩展正是为了满足这一要求。
 
-## Developing
+## 开发
 
-### Develop a sink
+### 开发 Sink (目标)
 
-To develop a sink for Kuiper is to implement [api.Sink](../../../xstream/api/stream.go) interface and export it as a golang plugin.
+为 Kuiper 开发 Sink (目标),是实现 [api.Sink](../../../xstream/api/stream.go) 接口并将其导出为 golang 插件。
 
-Before starting the development, you must [setup the environment for golang plugin](overview.md#setup-the-plugin-developing-environment). 
+在开始开发之前,您必须为 [golang 插件设置环境](overview.md#setup-the-plugin-developing-environment)。
 
-To develop a sink, the _Configure_ method must be implemented. This method will be called once the sink is initialized. In this method, a map that contains the configuration in the [rule actions definition](../rules/overview.md#actions) is passed in. Typically, there will be information such as host, port, user and password of the external system. You can use this map to initialize this sink.
+要开发 Sink (目标),必须实现 _Configure_ 方法。 接收器初始化后,将调用此方法。 在此方法中,将传入包含 [规则操作定义](../rules/overview.md#actions)中的配置映射,通常,将包含诸如外部系统的主机、端口、用户和密码之类的信息。您可以使用此映射来初始化此 Sink (目标)。
 
 ```go
 //Called during initialization. Configure the sink with the properties from action definition 
 Configure(props map[string]interface{}) error
 ```
-The next task is to implement _open_ method. The implementation should be synchronized to create a connection to the external system. A context parameter is provided to retrieve the context information, logger and rule meta information.
+下一个任务是实现 _open_ 方法。 该实现应和创建到外部系统的连接同步。 提供了上下文参数以检索上下文信息、日志和规则元信息。
+
 ```go
 //Should be sync function for normal case. The container will run it in go func
 Open(ctx StreamContext) error
-```  
+```
 
-The main task for a Sink is to implement _collect_ method. The function will be invoked when Kuiper feed any data into the sink. As an infinite stream, this function will be invoked continuously. The task of this function is to publish data to the external system. The first parameter is the context, and the second parameter is the data received from Kuiper.
+Sink (目标)的主要任务是实现 _collect_ 方法。 当 Kuiper 将任何数据输入 Sink (目标)时,将调用该函数。 作为无限流,此函数将被连续调用。 此功能的任务是将数据发布到外部系统。 第一个参数是上下文,第二个参数是从 Kuiper 接收的数据。
 
 ```go
 //Called when each row of data has transferred to this sink
 Collect(ctx StreamContext, data interface{}) error
-```  
+```
 
-The last method to implement is _Close_ which literally close the connection. It is called when the stream is about to terminate. You could also do any clean up work in this function.
+最后要实现的方法是 _Close_ ,它实际上关闭了连接。 当流即将终止时调用它。 您也可以在此函数中执行任何清理工作。
 
 ```go
 Close(ctx StreamContext) error
 ```
 
-As the sink itself is a plugin, it must be in the main package. Given the sink struct name is mySink. At last of the file, the sink must be exported as a symbol as below. There are [2 types of exported symbol supported](overview.md#plugin-development). For sink extension, states are usually needed, so it is recommended to export a constructor function.
+由于 Sink (目标)本身是一个插件,因此它必须位于主程序包中。 给定 Sink (目标)结构名称为 mySink。 在文件的最后,必须将 Sink (目标)导出为以下符号。 共有 [2种类型的导出符号](overview.md#plugin-development)。 对于 Sink (目标)扩展,通常需要状态,因此建议导出构造函数。
 
 ```go
 func MySink() api.Sink {
@@ -43,24 +44,25 @@ func MySink() api.Sink {
 }
 ```
 
-The [Memory Sink](../../../plugins/sinks/memory.go) is a good example.
+[Memory Sink](../../../plugins/sinks/memory.go) 是一个很好的示例。
 
-### Package the sink
-Build the implemented sink as a go plugin and make sure the output so file resides in the plugins/sinks folder.
+### 将 Sink (目标)打包
+将实现的 Sink (目标)构建为 go 插件,并确保输出的 so 文件位于 plugins/sinks 文件夹中。
 
 ```bash
 go build --buildmode=plugin -o plugins/sinks/MySink.so plugins/sinks/my_sink.go
 ```
 
-### Usage
+### 使用
+
+自定义 Sink (目标)在 [动作定义](../rules/overview.md#actions)规定。 它的名称用作操作的键, 配置就是值。
 
-The customized sink is specified in a [actions definition](../rules/overview.md#actions). Its name is used as the key of the action. The configuration is the value.
+如果您开发了 Sink (目标)实现 MySink,则应该具有:
+1. 在插件文件中,将导出符号 MySink。
+2. 编译的 MySink.so 文件位于 _plugins/sinks_ 内部
 
-If you have developed a sink implementation MySink, you should have:
-1. In the plugin file, symbol MySink is exported.
-2. The compiled MySink.so file is located inside _plugins/sinks_
+要使用它,请在规则定义内定义动作 mySink:
 
-To use it, define the action mySink inside a rule definition:
 ```json
 {
   "id": "rule1",
@@ -75,4 +77,4 @@ To use it, define the action mySink inside a rule definition:
   ]
 }
 ```
-Whereas, _mySink_ is a key of the actions. The value of mySink is the properties for that sink.
+而 _mySink_ 是动作的键。 mySink 的值是该 Sink (目标)的属性。

文件差异内容过多而无法显示
+ 38 - 38
docs/zh_CN/extension/source.md


+ 16 - 15
docs/zh_CN/json_expr.md

@@ -33,7 +33,9 @@
 
 ## 识别码
 
-源引用(`.`)源解引用运算符可用于通过引用源流或表来指定列。'->引用选择嵌套JSON对象中的键。
+源引用 (`.`)
+
+源解引用运算符可用于通过引用源流或表来指定列。`->` 引用选择嵌套 JSON对象中的键。
 
 ```
 SELECT demo.age FROM demo
@@ -83,7 +85,7 @@ SELECT d.friends[0]->last FROM demo AS d
 
 切片允许您选择数组的连续子集。
 
-``field[from:to]`` 如果未指定from,则表示从数组的第一个元素开始; 如果未指定to,则表示以数组的最后一个元素结尾。
+`field[from:to]` 如果未指定 from,则表示从数组的第一个元素开始; 如果未指定 to,则表示以数组的最后一个元素结尾。
 
 ```
 SELECT children[0:1] FROM demo
@@ -122,7 +124,7 @@ SELECT followers->Group1[:1]->first FROM demo
 
 # Json 路径函数
 
-Kuiper提供了一系列函数,以允许通过结构或数组列或值进行json路径操作。 这些函数是:
+Kuiper 提供了一系列函数,以允许通过结构或数组列或值进行 json 路径操作。 这些函数是:
 
 ```tsql
 json_path_exists(col, jsonpath)
@@ -132,24 +134,24 @@ json_path_query_first(col, jsonpath)
 
 请参考 [json 函数](sqls/built-in_functions.md#json-functions) 获得详细信息.
 
-所有这些函数共享相同的参数签名,其中,第二个参数是jsonpath字符串。 Kuiper使用的jsonpath语法基于[JsonPath](https://goessner.net/articles/JsonPath/)
+所有这些函数共享相同的参数签名,其中,第二个参数是 jsonpath 字符串。 Kuiper 使用的 jsonpath 语法基于[JsonPath](https://goessner.net/articles/JsonPath/)
 
-这些表达式的基本语法是将JSON对象的字段部分与一些元素结合使用:
+这些表达式的基本语法是将 JSON 对象的字段部分与一些元素结合使用:
 
-- 点`.`用于移动到树中
-- 括号`[]`用于访问给定位置的数组成员。 它还可以访问地图字段。
-- 变量,'$'表示JSON文本,'@'表示结果路径计算。
+- 点 `.` 用于移动到树中
+- 括号 `[]` 用于访问给定位置的数组成员。 它还可以访问地图字段。
+- 变量,`$` 表示 JSON 文本,`@` 表示结果路径计算。
 
-例如,当应用于上述的JSON数据示例时,我们可以使用这些表达式访问树的以下部分:
+例如,当应用于上述的 JSON 数据示例时,我们可以使用这些表达式访问树的以下部分:
 
 - `$.age` 指的是37。
-- `$.friends.first` 指的是 “dale”
+- `$.friends.first` 指的是 "dale"
 - `$.friends` 指的是完整的朋友数组。
 - `$.friends[0]` 指的是上一个数组中列出的第一个朋友(与数组成员相反,它们从零开始)。
-- `$.friends[0][lastname]` 是指列出的第一个朋友的姓氏.。如果[fields key]中有 [保留字](sqls/lexical_elements.md)或特殊字符(例如空格'','。'和中文等),请使用括号。
+- `$.friends[0][lastname]` 是指列出的第一个朋友的姓氏.。如果 fields key 中有 [保留字](sqls/lexical_elements.md)或特殊字符(例如空格 ' '、 '.'和中文等),请使用括号。
 - `$.friends[? @.age>60].first` 或者 `$.friends[? (@.age>60)].first` 是指年龄大于60岁的朋友的名字。请注意,?之间有空格, 并且条件是必需的,即使条件带有括号。
 
-开发人员可以在SQL语句中使用json函数。 这里有些例子。
+开发人员可以在 SQL 语句中使用 json 函数。 这里有些例子。
 
 - 查询第1组跟随者的姓氏
 ```tsql
@@ -172,8 +174,7 @@ SELECT json_path_exists(followers, "$.Group1[? @.age>30].last") FROM demo
 ["Miller"]
 ```
 
-- Assume there is a field in follows with reserved words or chars like dot `my.follower`, use bracket to access it.
-- 假设跟随者有一个字段有保留字或点之类的字符, 比如`my.follower`,使用括号访问它。
+- 假设跟随者有一个字段有保留字或点之类的字符, 比如 `my.follower`,使用括号访问它。
 ```tsql
 SELECT json_path_exists(followers, "$[\"my.follower\"]") FROM demo
 
@@ -188,7 +189,7 @@ SELECT json_path_exists(followers, "$[\"my.follower\"]") FROM demo
 
 ## 列表和切片映射
 
-通配符表达式创建列表映射,它是JSON数组上的映射。
+通配符表达式创建列表映射,它是 JSON 数组上的映射。
 
 ```
 SELECT demo.friends[*]->first FROM demo

+ 9 - 9
docs/zh_CN/operation/configuration_file.md

@@ -1,5 +1,5 @@
 # 基本配置
-Kuiper的配置文件位于$ kuiper / etc / kuiper.yaml中。 配置文件为yaml格式。
+Kuiper 的配置文件位于 `$ kuiper / etc / kuiper.yaml` 中。 配置文件为 yaml 格式。
 
 ## 日志级别
 
@@ -12,15 +12,15 @@ basic:
   # true|false, if it's set to true, then the log will be print to log file
   fileLog: true
 ```
-## Cli端口
+## Cli 端口
 ```yaml
 basic:
   # CLI port
   port: 20498
 ```
-CLI服务器监听端口
+CLI 服务器监听端口
 
-## REST服务配置
+## REST 服务配置
 
 ```yaml
 basic:
@@ -32,19 +32,19 @@ basic:
 ```
 
 #### restPort
-REST http服务器监听端口
+REST http 服务器监听端口
 
 #### restTls
-TLS证书cert文件和key文件位置。如果restTls选项未配置,则REST服务器将启动为http服务器,否则启动为https服务器。
+TLS 证书 cert 文件和 key 文件位置。如果 restTls 选项未配置,则 REST 服务器将启动为 http 服务器,否则启动为 https 服务器。
 
-## Prometheus配置
+## Prometheus 配置
 
-如果``prometheus``参数设置为true,Kuiper 将把运行指标暴露到prometheus。Prometheus将运行在``prometheusPort``参数指定的端口上。
+如果 `prometheus` 参数设置为 true,Kuiper 将把运行指标暴露到 prometheus。Prometheus 将运行在 `prometheusPort` 参数指定的端口上。
 
 ```yaml
 basic:
   prometheus: true
   prometheusPort: 20499
 ```
-在如上默认配置中,Kuiper暴露于Prometheusd 运行指标可通过``http://localhost:20499/metrics``访问。
+在如上默认配置中,Kuiper 暴露于 Prometheusd 运行指标可通过 `http://localhost:20499/metrics` 访问。
 

+ 5 - 5
docs/zh_CN/operation/install/cent-os.md

@@ -1,14 +1,14 @@
 # CentOS
 
-This document describes how to install on CentOS.
+本文件描述如何在 CentOS 上安装。
 
-## Install from zip
+## 从 ZIP 文件安装
 
-Unzip the installation package.
+解压安装包。
 
 ``unzip kuiper-centos7-v0.0.1.zip``
 
-Run the ``cli`` to verify Kuiper is installed successfully or not.
+运行 `cli` 来验证 Kuiper 是否已成功安装。
 
 ```shell
 # cd kuiper
@@ -16,5 +16,5 @@ Run the ``cli`` to verify Kuiper is installed successfully or not.
 kuiper version 0.0.1
 ```
 
-If it can print the version, then Kuiper is installed successfully. 
+如果可以打印版本,则说明 Kuiper 已成功安装。
 

+ 12 - 12
docs/zh_CN/operation/install/overview.md

@@ -1,13 +1,13 @@
-# Installation instruction
+# 安装说明
 
-Please download the installation package, and refer to below for the instruction of installing for different operate systems.
+请下载安装程序包,有关不同操作系统的安装说明,请参阅以下内容。
 
 - [Cent-OS](cent-os.md)
 - ...
 
-# Installation structure 
+# 安装目录结构 
 
-Below is the directory structure after installation. 
+下面是安装后的目录结构。
 
 ```shell
 bin
@@ -22,26 +22,26 @@ log
 
 ## bin
 
-The ``bin`` directory includes all of executable files. Such as ``cli`` command.
+`bin` 目录包含所有可执行文件。 如 `cli` 命令。
 
 ## etc
 
-The ``etc`` directory contains the configuration files of Kuiper. Such as MQTT source configurations etc.
+`etc` 目录包含 Kuiper 的配置文件, 例如 MQTT 源配置等。
 
 ## data
 
-Kuiper persistences all the definitions of streams and rules, and all of message will be stored in this folder  for long duration operations.
+Kuiper 会持久化流和规则的所有定义,并且所有消息都将存储在此文件夹中,以进行长时间操作。
 
 ## plugins
 
-Kuiper allows users to develop your own plugins, and put these plugins into this folder.  See [extension](../../extension/overview.md) for more info for how to extend the Kuiper.
+Kuiper 允许用户开发自己的插件,并将这些插件放入此文件夹。 有关如何扩展 Kuiper 的更多信息,请参见[扩展](../../extension/overview.md)。
 
 ## log
 
-All of the log files are under this folder. The default log file name is ``stream.log``.
+所有日志文件都在此文件夹下。 默认的日志文件名为 `stream.log`。
 
-# Next steps
+# 下一步
 
-- See [getting started](../../getting_started.md) for your first Kuiper experience.
-- See [CLI tools](../../cli/overview.md) for usage of Kuiper CLI tools.
+- 参考 [入门指导](../../getting_started.md) 开始您的 Kuiper 体验。
+- 参考 [CLI 工具](../../cli/overview.md) 了解 Kuiper CLI 工具的使用。
 

+ 3 - 3
docs/zh_CN/operation/operations.md

@@ -1,11 +1,11 @@
 # 配置
 
-- [Kuiper基本配置](configuration_file.md)
-- [MQTT 源配置](../rules/sources/mqtt.md)
+- [Kuiper 基本配置](configuration_file.md)
+- [MQTT  源配置](../rules/sources/mqtt.md)
 
 # Restful APIs
 
-Kuiper提供了一些RESTful管理API。
+Kuiper 提供了一些 RESTful 管理 API。
 
 
 

+ 1 - 1
docs/zh_CN/operation/overview.md

@@ -1,5 +1,5 @@
 
-Kuiper由Golang开发,可以在不同的操作系统上运行。 有关如何安装和操作Kuiper的信息,请参见下面的文档。
+Kuiper  Golang 开发,可以在不同的操作系统上运行。 有关如何安装和操作 Kuiper 的信息,请参见下面的文档。
 
 - [安装说明](install/overview.md)
 - [操作指南](operations.md)

+ 3 - 3
docs/zh_CN/plugins/overview.md

@@ -4,7 +4,7 @@ Kuiper 实现了几个插件。
 
 | 名称                  | 描述                                                  |
 | --------------------- | ------------------------------------------------------------ |
-| [zmq](sources/zmq.md)| 该插件监听Zero Mq消息并发送到Kuiper流中 |
+| [zmq](sources/zmq.md)| 该插件监听 Zero Mq 消息并发送到 Kuiper 流中 |
 | [random](sources/random.md) | 该插件按照指定模式生成消息   |
 
 
@@ -16,8 +16,8 @@ Kuiper 实现了几个插件。
 | 名称                  | 描述                                                  |
 | --------------------- | ------------------------------------------------------------ |
 | [file](sinks/file.md) | 该插件将分析结果保存到某个指定到文件系统中 |
-| [zmq](sinks/zmq.md)   | 该插件将分析结果发送到Zero Mq的主题中    |
-| [influxdb](sinks/influxdb.md)   | 该插件将分析结果发送到InfluxDB中    |
+| [zmq](sinks/zmq.md)   | 该插件将分析结果发送到 Zero Mq 的主题中  |
+| [influxdb](sinks/influxdb.md)   | 该插件将分析结果发送到 InfluxDB 中  |
 
 
 

文件差异内容过多而无法显示
+ 15 - 13
docs/zh_CN/plugins/plugins_tutorial.md


+ 11 - 11
docs/zh_CN/plugins/sinks/file.md

@@ -1,8 +1,8 @@
-# File Sink
+# 文件目标(Sink)
 
-The sink is used for saving analysis result into a specified file.
+目标(Sink)用于将分析结果保存到指定文件中。
 
-## Compile & deploy plugin
+## 编译和部署插件
 
 ```shell
 # cd $kuiper_src
@@ -10,18 +10,18 @@ The sink is used for saving analysis result into a specified file.
 # cp plugins/sinks/File.so $kuiper_install/plugins/sinks
 ```
 
-Restart the Kuiper server to activate the plugin.
+重新启动 Kuiper 服务器以激活插件。
 
-## Properties
+## 属性
 
-| Property name | Optional | Description                                                  |
-| ------------- | -------- | ------------------------------------------------------------ |
-| path          | false    | The file path for saving the result, such as ``/tmp/result.txt`` |
-| interval      | true     | The time interval (ms) for writing the analysis result. The default value is 1000, which means write the analysis result with every one second. |
+| 属性名称 | 是否可选 | 说明                                                         |
+| -------- | -------- | ------------------------------------------------------------ |
+| path     | 否       | 保存结果的文件路径,例如  `/tmp/result.txt`                  |
+| interval | 是       | 写入分析结果的时间间隔(毫秒)。 默认值为1000,这表示每隔一秒钟写入一次分析结果。 |
 
-## Sample usage
+## 使用示例
 
-Below is a sample for selecting temperature great than 50 degree, and save the result into file ``/tmp/result.txt`` with every 5 seconds.
+下面是一个选择温度大于50度的示例,每5秒将结果保存到文件 `/tmp/result.txt`  中。
 
 ```json
 {

+ 14 - 14
docs/zh_CN/plugins/sinks/influxdb.md

@@ -1,6 +1,6 @@
-# InfluxDB Sink
+# InfluxDB 目标(Sink
 
-该插件将分析结果发送到InfluxDB中
+该插件将分析结果发送到 InfluxDB 
 ## 编译插件&创建插件
 
 在编译之前,请对源代码做如下更改:
@@ -17,24 +17,24 @@
 # bin/cli create rule influx -f /tmp/influxRule.txt
 ```
 
-重新启动Kuiper服务器以激活插件。
+重新启动 Kuiper 服务器以激活插件。
 
 ## 属性
 
-| Property name | Optional | Description                                                  |
-| ------------- | -------- | ------------------------------------------------------------ |
-| addr          | true     | The addr of the InfluxDB |
-| measurement   | true     | The measurement of the InfluxDb (like table name) |
-| username      | false    | The InfluxDB login username |
-| password      | false    | The InfluxDB login password |
-| databasename  | true     | The database of the InfluxDB |
-| tagkey        | true     | The tag key of the InfluxDB |
-| tagvalue      | true     | The tag value of the InfluxDB |
+| 属性名称     | 会否可选 | 说明                     |
+| ------------ | -------- | ------------------------ |
+| addr         | 是       | InfluxDB的地址           |
+| measurement  | 是       | InfluxDb的测量(如表名) |
+| username     | 否       | InfluxDB登陆用户名       |
+| password     | 否       | InfluxDB登陆密码         |
+| databasename | 是       | InfluxDB的数据库         |
+| tagkey       | 是       | InfluxDB的标签键         |
+| tagvalue     | 是       | InfluxDB的标签值         |
 ## 示例用法
 
 下面是选择温度大于50度的样本规则,和一些配置文件仅供参考。
 
-#### /tmp/influxRule.txt
+#### ####/tmp/influxRule.txt
 ```json
 {
   "id": "influx",
@@ -55,7 +55,7 @@
   ]
 }
 ```
-#### /tmp/influxPlugin.txt
+#### ####/tmp/influxPlugin.txt
 ```json
 {
   "file":"http://localhost:8080/influx.zip"

+ 9 - 9
docs/zh_CN/plugins/sinks/zmq.md

@@ -1,8 +1,8 @@
-# Zmq Sink
+# Zmq 目标(Sink
 
-The sink will publish the result into a Zero Mq topic.
+目标(Sink)会将结果发布到 Zero Mq 主题中。
 
-## Compile & deploy plugin
+## 编译和部署插件
 
 ```shell
 # cd $kuiper_src
@@ -10,18 +10,18 @@ The sink will publish the result into a Zero Mq topic.
 # cp plugins/sinks/Zmq.so $kuiper_install/plugins/sinks
 ```
 
-Restart the Kuiper server to activate the plugin.
+重新启动 Kuiper 服务器以激活插件。
 
-## Properties
+## 属性
 
-| Property name | Optional | Description                                                  |
+| 属性名称 | Optional | Description                                                  |
 | ------------- | -------- | ------------------------------------------------------------ |
-| server          | false    | The url of the Zero Mq server |
+| server          | false    | Zero Mq 服务器的 URL |
 | topic      | true     | The topic to publish to |
 
-## Sample usage
+## 使用示例
 
-Below is a sample for selecting temperature great than 50 degree, and publish the result into Zero Mq topic "temp".
+下面是一个选择温度大于50度的示例,并将结果发布到 Zero Mq 主题 "temp"。
 
 ```json
 {

+ 16 - 16
docs/zh_CN/plugins/sources/random.md

@@ -1,8 +1,8 @@
-# Random Source
+# 随机源
 
-he source will generate random inputs with a specified pattern.
+随机源将生成具有指定样式的随机输入。
 
-## Compile & deploy plugin
+## 编译和部署插件
 
 ```shell
 # cd $kuiper_src
@@ -10,11 +10,11 @@ he source will generate random inputs with a specified pattern.
 # cp plugins/sources/Random.so $kuiper_install/plugins/sources
 ```
 
-Restart the Kuiper server to activate the plugin.
+重新启动 Kuiper 服务器以激活插件。
 
-## Configuration
+## 配置
 
-The configuration for this source is ``$kuiper/etc/sources/random.yaml``. The format is as below:
+该源的配置为 `$kuiper/etc/sources/random.yaml`。格式如下:
 
 ```yaml
 default:
@@ -31,31 +31,31 @@ dedup:
   interval: 100
   deduplicate: 50
 ```
-### Global configurations
+### 全局配置
 
-Use can specify the global random source settings here. The configuration items specified in ``default`` section will be taken as default settings for the source when running this source.
+用户可以在此处指定全局随机源设置。 运行此源时,将在 `default` 部分中指定的配置项目作为源的默认设置。
 
 ### interval
 
-The interval (ms) to issue a message.
+发出消息的间隔(毫秒)。
 
 ### seed
 
-The maximum integer to be produced by the random function
+随机函数产生的最大整数。
 
 ### pattern
 
-The pattern to be generated by the source. In the above example, the pattern will be a json like {"count":50}
+源生成的样式。 在上面的示例中,样式将为 json,例如{"count":50}
 
 ### deduplicate
 
-An int value. If it is a positive number, the source will not issue the messages which are duplicates of any of the previous 'deduplicate' length of messages. If it is 0, the source won't check for duplications. If it is a negative number, the source will check for duplicates over any previous messages. Do not use negative length if you have very large input data sets as all the previous data will be kept.
+一个整数值。 如果它为正数,则源不会发出与以前任何“重复数据删除”长度的消息重复的消息。如果为0,则源不会检查是否存在重复。如果是负数,则源将检查以前任何消息的重复项。如果有非常大的输入数据集,请不要使用负长度,因为将保留所有以前的数据。
 
-## Override the default settings
+## 覆盖默认设置
 
-If you have a specific connection that need to overwrite the default settings, you can create a customized section. In the previous sample, we create a specific setting named with ``test``.  Then you can specify the configuration with option ``CONF_KEY`` when creating the stream definition (see [stream specs](../../sqls/streams.md) for more info).
+如果您有特定的连接需要覆盖默认设置,则可以创建一个自定义部分。 在上一个示例中,我们创建一个名为 `test` 的特定设置。 然后,您可以在创建流定义时使用选项`CONF_KEY` 指定配置(有关更多信息,请参见 [stream specs](../../sqls/streams.md))。
 
-## Sample usage
+## 使用示例
 
 ```
 demo (
@@ -63,5 +63,5 @@ demo (
 	) WITH (DATASOURCE="demo", FORMAT="JSON", CONF_KEY="ext", TYPE="random");
 ```
 
-The configuration keys "ext" will be used.
+配置键 "ext" 将被使用。
 

+ 13 - 13
docs/zh_CN/plugins/sources/zmq.md

@@ -1,8 +1,8 @@
-# Zmq Source
+# Zmq 
 
-The source will subscribe to a Zero Mq topic to import the messages into kuiper
+源将订阅 Zero Mq 主题以将消息导入 kuiper。
 
-## Compile & deploy plugin
+## 编译和部署插件
 
 ```shell
 # cd $kuiper_src
@@ -10,11 +10,11 @@ The source will subscribe to a Zero Mq topic to import the messages into kuiper
 # cp plugins/sources/Zmq.so $kuiper_install/plugins/sources
 ```
 
-Restart the Kuiper server to activate the plugin.
+重新启动 Kuiper 服务器以激活插件。
 
-## Configuration
+## 配置
 
-The configuration for this source is ``$kuiper/etc/sources/zmq.yaml``. The format is as below:
+该源的配置位于 `$kuiper/etc/sources/zmq.yaml`。格式如下:
 
 ```yaml
 #Global Zmq configurations
@@ -23,19 +23,19 @@ default:
 test:
   server: tcp://127.0.0.1:5563
 ```
-### Global configurations
+### 全局配置
 
-Use can specify the global zmq source settings here. The configuration items specified in ``default`` section will be taken as default settings for the source when connects to Zero Mq.
+用户可以在此处指定全局 zmq 源设置。 连接到Zero Mq 时,`default` 部分中指定的配置项目将被用作源的默认设置。
 
 ### server
 
-The url of the Zero Mq server that the source will subscribe to.
+源将订阅的Zero Mq 服务器的 URL。
 
-## Override the default settings
+## 覆盖默认设置
 
-If you have a specific connection that need to overwrite the default settings, you can create a customized section. In the previous sample, we create a specific setting named with ``test``.  Then you can specify the configuration with option ``CONF_KEY`` when creating the stream definition (see [stream specs](../../sqls/streams.md) for more info).
+如果您有特定的连接需要覆盖默认设置,则可以创建一个自定义部分。 在上一个示例中,我们创建一个名为 `test` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [stream specs](../../sqls/streams.md))。
 
-## Sample usage
+## 使用示例
 
 ```
 demo (
@@ -43,5 +43,5 @@ demo (
 	) WITH (DATASOURCE="demo", FORMAT="JSON", CONF_KEY="test", TYPE="zmq");
 ```
 
-The configuration keys "test" will be used. The Zero Mq topic to subscribe is "demo" as specified in the ``DATASOURCE``.
+将使用配置键 "test"。 订阅的 Zero Mq 主题是 `DATASOURCE` 中指定的 "demo"。
 

文件差异内容过多而无法显示
+ 8 - 8
docs/zh_CN/quick_start_docker.md


+ 4 - 4
docs/zh_CN/reference.md

@@ -2,12 +2,12 @@
 
 
 
-请参考以下主题,以获取有关使用Kuiper的指导。
+请参考以下主题,以获取有关使用 Kuiper 的指导。
 
 - [安装与操作](operation/overview.md)
-- [命令行界面工具-CLI](cli/overview.md)
-- [Kuiper SQL参考](sqls/overview.md)
+- [命令行界面工具 CLI](cli/overview.md)
+- [Kuiper SQL 参考](sqls/overview.md)
 - [规则](rules/overview.md)
-- [扩展Kuiper](extension/overview.md)
+- [扩展 Kuiper](extension/overview.md)
 - [插件](plugins/overview.md)
 

+ 5 - 5
docs/zh_CN/restapi/overview.md

@@ -1,8 +1,8 @@
-Kuiper provides a set of REST API for streams and rules management in addition to CLI. 
+除 CLI 外,Kuiper 还提供了一组用于流和规则管理的 REST API。
 
-By default, the REST API are running in port 9081. You can change the port in `/etc/kuiper.yaml` for the `restPort` property.
+默认情况下,REST API 在端口9081中运行。您可以在 `/etc/kuiper.yaml` 中通过`restPort` 属性更改端口。
 
-- [Streams](streams.md)
-- [Rules](rules.md)
-- [Plugins](plugins.md)
+- [](streams.md)
+- [规则](rules.md)
+- [插件](plugins.md)
 

+ 27 - 24
docs/zh_CN/restapi/plugins.md

@@ -1,18 +1,19 @@
+Kuiper REST api 允许您管理插件,例如创建、删除和列出插件。 请注意,删除插件将需要重新启动 kuiper 才能生效。 要更新插件,请执行以下操作:
 
-The Kuiper REST api for plugins allows you to manage plugins, such as create, drop and list plugins. Notice that, drop a plugin will need to restart kuiper to take effect. To update a plugin, do the following:
-1. Drop the plugin.
-2. Restart Kuiper.
-3. Create the plugin with the new configuration.
+1. 删除插件。
+2. 重新启动 Kuiper。
+3. 使用新配置创建插件。
 
-## create a plugin
+## 创建插件
+
+该API接受JSON内容以创建新的插件。 每种插件类型都有一个独立的端点。 支持的类型为 `["源", "目标", "函数"]`。 插件由名称标识。 名称必须唯一。
 
-The API accepts a JSON content to create a new plugin. Each plugin type has a standalone endpoint. The supported types are `["sources", "sinks", "functions"]`. The plugin is identified by the name. The name must be unique.
 ```shell
 POST http://localhost:9081/plugins/sources
 POST http://localhost:9081/plugins/sinks
 POST http://localhost:9081/plugins/functions
 ```
-Request Sample
+请求示例:
 
 ```json
 {
@@ -21,21 +22,22 @@ Request Sample
 }
 ```
 
-### Parameters
+### 参数
 
-1. name: a unique name of the plugin. The name must be the same as the camel case version of the plugin with lowercase first letter. For example, if the exported plugin name is `Random`, then the name of this plugin is `random`.
-2. file: the url of the plugin files. It must be a zip file with: a compiled so file and the yaml file(only required for sources). If the plugin depends on some external dependencies, a bash script named install.sh can be provided to do the dependency installation. The name of the files must match the name of the plugin. Please check [Extension](../extension/overview.md) for the naming rule.
+1. name:插件的唯一名称。 名称必须采用首字母小写的驼峰命名法。 例如,如果导出的插件名称为 `Random`,则此插件的名称为 `random`。
+2. file:插件文件的 URL。 它必须是一个 zip 文件,其中包含:编译后的 so 文件和yaml 文件(仅源必需)。 如果插件依赖于某些外部依赖项,则可以提供一个名为install.sh 的 bash 脚本来进行依赖项安装。 文件名称必须与插件名称匹配。 请参考[扩展](../extension/overview.md) 了解命名规则。
 
-### Plugin File Format
-A sample zip file for a source named random.zip
+### 插件文件格式
+名为 random.zip 的源的示例 zip 文件
 1. Random@v1.0.0.so
 2. random.yaml
 3. install.sh
-4. Various dependency files/folders of install.sh   
+4. install.sh 的各种依赖文件/文件夹
    - mysdk.zip
    - myconfig.conf  
 
-Notice that, the install.sh will be run that the system may already had the lib or package. Make sure to check the path before. Below is an example install.sh to install a sample sdk lib. 
+请注意,将在系统可能已经具有库或软件包的情况下运行 install.sh。 确保在运行之前检查路径。 下面是一个示例 install.sh,用于安装示例 sdk 库。 
+
 ```bash
 #!/bin/sh
 dir=/usr/local/mysdk
@@ -69,9 +71,9 @@ ldconfig
 echo "Done"
 ```
 
-## show plugins
+## 显示插件
 
-The API is used for displaying all of plugins defined in the server for a plugin type.
+该 API 用于显示服务器中为插件类型定义的所有插件。
 
 ```shell
 GET http://localhost:9081/plugins/sources
@@ -79,15 +81,15 @@ GET http://localhost:9081/plugins/sinks
 GET http://localhost:9081/plugins/functions
 ```
 
-Response Sample:
+响应示例:
 
 ```json
 ["plugin1","plugin2"]
 ```
 
-## describe a plugin
+## 描述插件
 
-The API is used to print out the detailed definition of a plugin.
+该 API 用于打印插件的详细定义。
 
 ```shell
 GET http://localhost:9081/plugins/sources/{name}
@@ -95,9 +97,9 @@ GET http://localhost:9081/plugins/sinks/{name}
 GET http://localhost:9081/plugins/functions/{name}
 ```
 
-Path parameter `name` is the name of the plugin.
+路径参数 `name` 是插件的名称。
 
-Response Sample: 
+响应示例:
 
 ```json
 {
@@ -106,16 +108,17 @@ Response Sample:
 }
 ```
 
-## drop a plugin
+## 删除插件
 
-The API is used for drop the plugin. The kuiper server needs to be restarted to take effect.
+该 API 用于删除插件。 需要重启 kuiper 服务器才能生效。
 
 ```shell
 DELETE http://localhost:8080/plugins/sources/{name}
 DELETE http://localhost:8080/plugins/sinks/{name}
 DELETE http://localhost:8080/plugins/functions/{name}
 ```
-The user can pass a query parameter to decide if Kuiper should be stopped after a delete in order to make the deletion take effect. The parameter is `restart` and only when the value is `1` will the Kuiper be stopped. The user has to manually restart it.
+用户可以传递查询参数来决定是否应在删除后停止 Kuiper,以使删除生效。 参数是`restart`,只有当值是1时,Kuiper 才停止。 用户必须手动重新启动它。
+
 ```shell
 DELETE http://localhost:8080/plugins/sources/{name}?restart=1
 ```

+ 25 - 24
docs/zh_CN/restapi/rules.md

@@ -1,14 +1,14 @@
-# Rules management
+# 规则管理
 
-The Kuiper REST api for rules allows you to manage rules, such as create, show, drop, describe, start, stop and restart rules. 
+Kuiper REST api 可以管理规则,例如创建、显示、删除、描述、启动、停止和重新启动规则。
 
-## create a rule
+## 创建规则
 
-The API accepts a JSON content and create and start a rule.
+该 API 接受 JSON 内容并创建和启动规则。
 ```shell
 POST http://localhost:9081/rules
 ```
-Request Sample
+请求示例:
 
 ```json
 {
@@ -21,15 +21,15 @@ Request Sample
 ```
 
 
-## show rules
+## 展示规则
 
-The API is used for displaying all of rules defined in the server with a brief status.
+该 API 用于显示服务器中定义的所有规则和简要状态描述。
 
 ```shell
 GET http://localhost:9081/rules
 ```
 
-Response Sample:
+响应示例:
 
 ```json
 [
@@ -44,17 +44,17 @@ Response Sample:
 ]
 ```
 
-## describe a rule
+## 描述规则
 
-The API is used for print the detailed definition of rule.
+该 API 用于打印规则的详细定义。
 
 ```shell
 GET http://localhost:9081/rules/{id}
 ```
 
-Path parameter `id` is the id or name of the rule.
+路径参数  `id` 是规则的 id 或名称。
 
-Response Sample: 
+响应示例:
 
 ```json
 {
@@ -73,51 +73,52 @@ Response Sample:
 }
 ```
 
-## drop a rule
+## 删除规则
 
-The API is used for drop the rule.
+该 API 用于删除规则。
 
 ```shell
 DELETE http://localhost:8080/rules/{id}
 ```
 
 
-## start a rule
+## 启动规则
 
-The API is used to start running the rule.
+该 API 用于开始运行规则。
 
 ```shell
 POST http://localhost:8080/rules/{id}/start
 ```
 
 
-## stop a rule
+## 停止规则
 
-The API is used to stop running the rule.
+该 API 用于停止运行规则。
 
 ```shell
 POST http://localhost:8080/rules/{id}/stop
 ```
 
-## restart a rule
+## 重启规则
 
-The API is used to restart the rule.
+该 API 用于重启规则。
 
 ```shell
 POST http://localhost:8080/rules/{id}/restart
 ```
 
-## get the status of a rule
+## 获取规则的状态
+
+该命令用于获取规则的状态。 如果规则正在运行,则将实时检索状态指标。 状态可以是:
 
-The command is used to get the status of the rule. If the rule is running, the metrics will be retrieved realtime. The status can be
 - $metrics
-- stopped: $reason
+- 停止: $reason
 
 ```shell
 GET http://localhost:8080/rules/{id}/status
 ```
 
-Response Sample:
+响应示例:
 
 ```shell
 {

+ 14 - 14
docs/zh_CN/restapi/streams.md

@@ -1,45 +1,45 @@
-# Streams management
+# 流管理
 
-The Kuiper REST api for streams allows you to manage the streams, such as create, describe, show and drop stream definitions.
+Kuiper REST api 可用于管理流,例如创建、描述、显示和删除流定义。
 
-## create a stream
+## 创建流
 
-The API is used for creating a stream. For more detailed information of stream definition, please refer to [streams](../sqls/streams.md).
+该 API 用于创建流。 有关流定义的更多详细信息,请参考[流](../sqls/streams.md)。
 
 ```shell
 POST http://localhost:9081/streams
 ```
-Request sample, the request is a json string with `sql` field.
+请求示例,请求命令是带有 `sql` 字段的 json 字符串。
 
 ```json
 {"sql":"create stream my_stream (id bigint, name string, score float) WITH ( datasource = \"topic/temperature\", FORMAT = \"json\", KEY = \"id\")"}
 ```
 
-This API can run any stream sql statements, not only stream creation.
+该 API 可以运行任何流 sql 语句,而不仅可以创建流。
 
-## show streams
+## 显示流
 
-The API is used for displaying all of streams defined in the server.
+该 API 用于显示服务器中定义的所有流。
 
 ```shell
 GET http://localhost:9081/streams
 ```
 
-Response Sample:
+响应示例:
 
 ```json
 ["mystream"]
 ```
 
-## describe a stream
+## 描述流
 
-The API is used for print the detailed definition of stream.
+该 API 用于打印流的详细定义。
 
 ```shell
 GET http://localhost:9081/streams/{id}}
 ```
 
-Response Sample:
+响应示例:
 
 ```shell
 {
@@ -65,9 +65,9 @@ Response Sample:
 }
 ```
 
-## drop a stream
+## 删除流
 
-The API is used for drop the stream definition.
+该 API 用于删除流定义。
 
 ```shell
 DELETE http://localhost:9081/streams/{id}

文件差异内容过多而无法显示
+ 30 - 30
docs/zh_CN/rules/overview.md


+ 27 - 27
docs/zh_CN/rules/sinks/edgex.md

@@ -2,17 +2,17 @@
 
 该目标用于将消息发送到 EdgeX 消息总线上。
 
-| name        | Optional | Description                                                  |
+| 名称        | 可选 | Description                                                  |
 | ----------- | -------- | ------------------------------------------------------------ |
-| protocol    | true     | 如未指定,使用缺省值 ``tcp``.                                |
-| host        | true     | 消息总线目标主机地址,使用缺省值 ``*``.                      |
-| port        | true     | 消息总线端口号。 如未指定,使用缺省值 ``5563``.              |
-| topic       | true     | 发布的主题名称,如未指定,使用缺省值 ``events``.             |
-| contentType | true     | 发布消息的内容类型,如未指定,使用缺省值 ``application/json``. |
-| metadata    | true     | 该属性为一个字段名称,该字段是 SQL SELECT 子句的一个字段名称,这个字段应该类似于 ``meta(*) AS xxx`` ,用于选出消息中所有的 EdgeX 元数据. |
-| deviceName  | true     | 允许用户指定设备名称,该名称将作为从 Kuiper 中发送出来的 Event 结构体的设备名称. |
-| type          | true     | 消息总线类型,目前支持两种类型的消息总线, ``zero`` 或者 ``mqtt``,其中 ``zero`` 为缺省类型。 |
-| optional      | true     | 如果指定了 ``mqtt`` 消息总线,那么还可以指定一下可选的值。请参考以下可选的支持的配置类型。 |
+| protocol    | true     | 如未指定,使用缺省值 `tcp`.                                |
+| host        |     | 消息总线目标主机地址,使用缺省值 `*`.                      |
+| port        |     | 消息总线端口号。 如未指定,使用缺省值 `5563`.              |
+| topic       |     | 发布的主题名称,如未指定,使用缺省值 `events`.             |
+| contentType |     | 发布消息的内容类型,如未指定,使用缺省值 `application/json`. |
+| metadata    |     | 该属性为一个字段名称,该字段是 SQL SELECT 子句的一个字段名称,这个字段应该类似于 `meta(*) AS xxx` ,用于选出消息中所有的 EdgeX 元数据. |
+| deviceName  |     | 允许用户指定设备名称,该名称将作为从 Kuiper 中发送出来的 Event 结构体的设备名称. |
+| type          |     | 消息总线类型,目前支持两种类型的消息总线, `zero` 或者 `mqtt`,其中 `zero` 为缺省类型。 |
+| optional      | 是    | 如果指定了 `mqtt` 消息总线,那么还可以指定一下可选的值。请参考以下可选的支持的配置类型。 |
 
 以下为支持的可选的配置列表,您可以参考 MQTT 协议规范来获取更详尽的信息。
 
@@ -32,10 +32,10 @@
 
 ## 例子
 
-### 发布结果到 EdgeX 消息总线,而不保留原有的元数据
-在此情况下,原有的元数据 (例如``Events`` 结构体中的 ``id, pushed, created, modified, origin``,以及``Reading`` 结构体中的  ``id, created, modified, origin, pushed, device`` 不会被保留)。Kuiper 在此情况下作为 EdgeX 的一个单独微服务,它有自己的 ``device name``。 提供了属性 ``deviceName``, 该属性允许用户指定 Kuiper 的设备名称。如下所示,
+### 发布结果到  EdgeX 消息总线,而不保留原有的元数据
+在此情况下,原有的元数据 (例如 `Events` 结构体中的 `id, pushed, created, modified, origin`,以及`Reading` 结构体中的  `id, created, modified, origin, pushed, device` 不会被保留)。Kuiper 在此情况下作为 EdgeX 的一个单独微服务,它有自己的 `device name`。 提供了属性 `deviceName`, 该属性允许用户指定 Kuiper 的设备名称。如下所示,
 
-1) 从 EdgeX 消息总线上的 ``events`` 主题上收到的消息,
+1) 从 EdgeX 消息总线上的 `events` 主题上收到的消息,
 
 ```
 {
@@ -47,7 +47,7 @@
   ]
 }
 ```
-2) 使用如下的规则,并且在 ``edgex`` action 中给属性 ``deviceName`` 指定 ``kuiper``。
+2) 使用如下的规则,并且在 `edgex` action 中给属性 `deviceName` 指定 ``kuiper``。
 
 ```json
 {
@@ -80,15 +80,15 @@
 }
 ```
 请注意,
-- Event 结构体中的设备名称( `` Device``)变成了 ``kuiper``
-- ``Events and Readings`` 结构体中的数据被更新为新的值. 字段 ``Created`` 被 Kuiper 更新为新的值 (这里为 ``0``).
+- Event 结构体中的设备名称( ``Device`)变成了 `kuiper`
+- `Events and Readings` 结构体中的数据被更新为新的值。 字段 `Created` 被 Kuiper 更新为新的值 (这里为 `0`).
 
-### 发布结果到 EdgeX 消息总线,并保留原有的元数据
-但是在某些场景中,你可能需要保留原来的元数据。比如保留发送到 Kuiper 的设备名称,在本例中为 ``demo``, 还有 reading 数组中的其它元数据。在此情况下,Kuiper 更像是一个过滤器 - 将不关心的数据过滤掉,但是依然保留原有的数据。
+### 发布结果到  EdgeX 消息总线,并保留原有的元数据
+但是在某些场景中,你可能需要保留原来的元数据。比如保留发送到 Kuiper 的设备名称,在本例中为 `demo`, 还有 reading 数组中的其它元数据。在此情况下,Kuiper 更像是一个过滤器 - 将不关心的数据过滤掉,但是依然保留原有的数据。
 
 参考以下的例子,
 
-1) 从 EdgeX 消息总线上的 ``events`` 主题上收到的消息,
+1) 从 EdgeX 消息总线上的 `events` 主题上收到的消息,
 
 ```
 {
@@ -100,7 +100,7 @@
   ]
 }
 ```
-2) 使用如下规则,在``edgex`` action 中,为 ``metadata`` 指定值 ``edgex_meta`` 。
+2) 使用如下规则,在`edgex` action 中,为 `metadata` 指定值 `edgex_meta` 。
 
 ```json
 {
@@ -121,8 +121,8 @@
 }
 ```
 请注意,
-- 用户需要在 SQL 子句中加 ``meta(*) AS edgex_meta`` ,函数 ``meta(*)`` 返回所有的元数据。
-- 在 ``edgex`` action里, 属性 ``metadata`` 指定值 ``edgex_meta`` 。该属性指定哪个字段包含了元数据。
+- 用户需要在 SQL 子句中加 `meta(*) AS edgex_meta` ,函数 `meta(*)` 返回所有的元数据。
+- 在 `edgex` action里, 属性 `metadata` 指定值 `edgex_meta` 。该属性指定哪个字段包含了元数据。
 
 3) 发送给 EdgeX 消息总线的数据
 
@@ -137,16 +137,16 @@
 }
 ```
 请注意,
-- ``Events`` 结构体的元数据依然保留,例如 ``Device`` & ``Created``.
-- 对于在原有消息中可以找到的 reading,元数据将继续保留。 比如 ``humidity`` 的元数据就是从 EdgeX 消息总线里接收到的``原值 - 或者说是旧值``。
-- 对于在原有消息中无法找到的 reading,元数据将不会被设置。如例子中的``t1`` 的元数据被设置为 Kuiper 产生的缺省值。
+- `Events` 结构体的元数据依然保留,例如 `Device` & `Created`.
+- 对于在原有消息中可以找到的 reading,元数据将继续保留。 比如 `humidity` 的元数据就是从 EdgeX 消息总线里接收到的`原值 - 或者说是旧值`。
+- 对于在原有消息中无法找到的 reading,元数据将不会被设置。如例子中的 `t1` 的元数据被设置为 Kuiper 产生的缺省值。
 - 如果你的 SQL 包含了聚合函数,那保留原有的元数据就没有意义,但是 Kuiper 还是会使用时间窗口中的某一条记录的元数据。例如,在下面的 SQL 里,
 ```SELECT avg(temperature) AS temperature, meta(*) AS edgex_meta FROM ... GROUP BY TUMBLINGWINDOW(ss, 10)```. 
-这种情况下,在时间窗口中可能有几条数据,Kuiper 会使用窗口中的第一条数据的元数据来填充 ``temperature`` 的元数据。
+这种情况下,在时间窗口中可能有几条数据,Kuiper 会使用窗口中的第一条数据的元数据来填充 `temperature` 的元数据。
 
 ## 结果发布到 MQTT 消息总线
 
-以下是将分析结果发送到 MQTT 消息总线的规则,请注意在``optional`` 中是如何指定 ``ClientId`` 的。
+以下是将分析结果发送到 MQTT 消息总线的规则,请注意在`optional` 中是如何指定 `ClientId` 的。
 
 ```json
 {

+ 1 - 1
docs/zh_CN/rules/sinks/logs.md

@@ -1,6 +1,6 @@
 # 日志操作
 
-该操作用于将输出消息打印到日志文件中,默认情况下,该日志文件位于$ kuiper_install/log/stream.log中。
+该操作用于将输出消息打印到日志文件中,默认情况下,该日志文件位于 `$ kuiper_install/log/stream.log` 中。
 
 无法为操作指定属性。
 

+ 11 - 11
docs/zh_CN/rules/sinks/mqtt.md

@@ -1,18 +1,18 @@
 # MQTT动作
 
-该操作用于将输出消息发布到MQTT服务器中。
+该操作用于将输出消息发布到 MQTT 服务器中。
 
-| Property name | Optional | Description                                          |
+| 属性名称 | 是否可选 | 说明                                          |
 | ------------- | -------- | ---------------------------------------------------- |
-| server        | false    | mqtt服务器的代理地址,例如``tcp://127.0.0.1:1883`` |
-| topic          | false    | mqtt主题,例如``分析/结果``                          |
-| clientId      | true     | mqtt连接的客户端ID。 如果未指定,将使用一个uuid      |
-| protocolVersion   | true     | 3.1 (也被称为 MQTT 3) 或者 3.1.1 (也被称为 MQTT 4)。 如果未指定,缺省值为 3.1。|
-| qos               | true     | 消息转发的服务质量                               |
-| username          | true     | 连接用户名                            |
-| password          | true     | 连接密码                             |
-| certificationPath | true     | 证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行``server``命令的路径。比如,如果你在``/var/kuiper`` 中运行 ``bin/server`` ,那么父目录为 ``/var/kuiper``; 如果运行从``/var/kuiper/bin``中运行``./server``,那么父目录为 ``/var/kuiper/bin``。 |
-| privateKeyPath    | true     | 私钥路径。可以为绝对路径,也可以为相对路径。更详细的信息,请参考 ``certificationPath``. |
+| server        | 否    | mqtt  服务器的代理地址,例如 `tcp://127.0.0.1:1883` |
+| topic          | 否    | mqtt 主题,例如``分析/结果``                         |
+| clientId      | 是     | mqtt 连接的客户端 ID。 如果未指定,将使用一个 uuid   |
+| protocolVersion   |     | 3.1 (也被称为 MQTT 3) 或者 3.1.1 (也被称为 MQTT 4)。 如果未指定,缺省值为 3.1。|
+| qos               |     | 消息转发的服务质量                               |
+| username          |     | 连接用户名                            |
+| password          |     | 连接密码                             |
+| certificationPath |     | 证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 `server` 命令的路径。比如,如果你在 `/var/kuiper` 中运行 `bin/server` ,那么父目录为 `/var/kuiper`; 如果运行从 `/var/kuiper/bin` 中运行`./server`,那么父目录为 `/var/kuiper/bin`。 |
+| privateKeyPath    |     | 私钥路径。可以为绝对路径,也可以为相对路径。更详细的信息,请参考 `certificationPath`. |
 
 以下为使用 SAS 连接到 Azure IoT Hub 的样例。
 ```json

+ 3 - 3
docs/zh_CN/rules/sinks/nop.md

@@ -1,9 +1,9 @@
 # Nop action
 
-该 action 是一个空操作目标,所有发送到此的结果将被忽略。如果指定 ``log`` 属性为 ``true``,那么结果将会保存到日志文件,日志文件缺省保存在  `` $kuiper_install/log/stream.log``。
+该 action 是一个空操作目标,所有发送到此的结果将被忽略。如果指定 ``log`` 属性为 `true`,那么结果将会保存到日志文件,日志文件缺省保存在  `$kuiper_install/log/stream.log`。
 
-| Property name      | Optional | Description                                                  |
+| 属性名称  | 是否可选 | 说明                                                  |
 | ------------------ | -------- | ------------------------------------------------------------ |
-| log             | true | true/false - 是否将结果打印到日志。缺省为 ``false``,这种情况下将不会打印到日志文件。 |
+| log             | true | true/false - 是否将结果打印到日志。缺省为 `false`,这种情况下将不会打印到日志文件。 |
 
 

文件差异内容过多而无法显示
+ 11 - 10
docs/zh_CN/rules/sinks/rest.md


+ 22 - 22
docs/zh_CN/rules/sources/edgex.md

@@ -23,25 +23,25 @@ EdgeX 源会试图取得某个字段的类型,
 
 ### Boolean
 
-如果 ``ValueDescriptor````Type`` 的值为 ``Bool`` ,那么 Kuiper 会试着将其转换为 ``boolean`` 类型,以下的值将被转化为 ``true``。
+如果 `ValueDescriptor` 中  `Type` 的值为 `Bool` ,那么 Kuiper 会试着将其转换为 ``boolean`` 类型,以下的值将被转化为 `true`。
 
 - "1", "t", "T", "true", "TRUE", "True" 
 
-以下值将被转换为 ``false``。
+以下值将被转换为 `false`。
 
 - "0", "f", "F", "false", "FALSE", "False"
 
 ### Bigint
 
-如果 ``ValueDescriptor````Type`` 的值为 ``INT8`` , ``INT16``, ``INT32``,  ``INT64`` , ``UINT8`` , ``UINT16`` ,  ``UINT32`` , ``UINT64`` 那么 Kuiper 会试着将其转换为 ``Bigint`` 类型。 
+如果 `ValueDescriptor` 中  `Type` 的值为 `INT8` , `INT16`, `INT32`,  `INT64` , `UINT8` , `UINT16` ,  `UINT32` , `UINT64` 那么 Kuiper 会试着将其转换为 `Bigint` 类型。 
 
 ### Float
 
-如果 ``ValueDescriptor````Type`` 的值为 ``FLOAT32``, ``FLOAT64`` ,那么 Kuiper 会试着将其转换为 ``Float`` 类型。 
+如果 `ValueDescriptor` 中  `Type` 的值为 `FLOAT32`, `FLOAT64` ,那么 Kuiper 会试着将其转换为 `Float` 类型。 
 
 ### String
 
-如果 ``ValueDescriptor````Type`` 的值为 ``String``,那么 Kuiper 会试着将其转换为 ``String`` 类型。
+如果 `ValueDescriptor` 中  `Type` 的值为 `String`,那么 Kuiper 会试着将其转换为 `String` 类型。
 
 ### Boolean 数组
 
@@ -49,15 +49,15 @@ EdgeX 中的 `Bool` 数组类型会被转换为 `boolean` 数组。
 
 ### Bigint 数组
 
-EdgeX 中所有的 ``INT8`` , ``INT16``, ``INT32``,  ``INT64``,``UINT`` , ``UINT8`` , ``UINT16`` ,  ``UINT32`` , ``UINT64``  数组类型会被转换为 `Bigint` 数组。
+EdgeX 中所有的 `INT8` , `INT16`, `INT32`,  `INT64` , `UINT8` , `UINT16` ,  `UINT32` , `UINT64` 数组类型会被转换为 `Bigint` 数组。
 
 ### Float 数组
 
-EdgeX 中所有的 ``FLOAT32``, ``FLOAT64``  数组类型会被转换为 `Float` 数组。 
+EdgeX 中所有的 `FLOAT32`, `FLOAT64`  数组类型会被转换为 `Float` 数组。 
 
 # 全局配置
 
-EdgeX 源配置文件为 ``$kuiper/etc/sources/edgex.yaml``,以下配置文件内容。
+EdgeX 源配置文件为 `$kuiper/etc/sources/edgex.yaml`,以下配置文件内容。
 
 ```yaml
 #Global Edgex configurations
@@ -73,38 +73,38 @@ default:
 #    Password: password
 ```
 
-用户可以在此指定全局的 EdgeX 配置。在 ``default`` 部分中指定的配置将作为所有 EdgeX 源的缺省配置。
+用户可以在此指定全局的 EdgeX 配置。在 `default` 部分中指定的配置将作为所有 EdgeX 源的缺省配置。
 
 ## protocol
 
-连接到 EdgeX 消息总线的协议,缺省为 ``tcp``
+连接到 EdgeX 消息总线的协议,缺省为 `tcp`
 
 ## server
 
-EdgeX 消息总线的地址,缺省为 ``localhost``
+EdgeX 消息总线的地址,缺省为 `localhost`
 
 ## port
 
-EdgeX 消息总线的端口,缺省为 ``5573``
+EdgeX 消息总线的端口,缺省为 `5573`
 
 ## topic
 
-EdgeX 消息总线上监听的主题名称,缺省为 ``events``
+EdgeX 消息总线上监听的主题名称,缺省为 `events`
 
 ## serviceServer
 
-访问 value descriptors 的基础服务地址,配置项 ``serviceServer`` 的值与 ``/api/v1/valuedescriptor`` 拼接后,用于获取 EdgeX 服务器上定义的所有 value descriptors。
+访问 value descriptors 的基础服务地址,配置项 `serviceServer` 的值与 `/api/v1/valuedescriptor` 拼接后,用于获取 EdgeX 服务器上定义的所有 value descriptors。
 
 ## type
 
-EdgeX 消息总线类型,目前支持两种消息总线。如果指定了错误的消息总线类型,那么会使用缺省 ``zero`` 类型。
+EdgeX 消息总线类型,目前支持两种消息总线。如果指定了错误的消息总线类型,那么会使用缺省 `zero` 类型。
 
-- ``zero``:使用 ZeroMQ 类型的消息总线 
-- ``mqtt``:使用 MQTT 服务器作为消息总线
+- `zero`:使用 ZeroMQ 类型的消息总线 
+- `mqtt`:使用 MQTT 服务器作为消息总线
 
 ## optional
 
-如果使用了 MQTT 消息总线,还可以指定别的一些可选配置项。请注意,所有在可选的配置项里指定的值都必须为**<u>字符类型</u>**,因此这里出现的所有的配置应该是字符类型的 - 例如 ``KeepAlive: "5000"``。以下为支持的可选的配置列表,您可以参考 MQTT 协议规范来获取更详尽的信息。
+如果使用了 MQTT 消息总线,还可以指定别的一些可选配置项。请注意,所有在可选的配置项里指定的值都必须为**<u>字符类型</u>**,因此这里出现的所有的配置应该是字符类型的 - 例如 `KeepAlive: "5000"`。以下为支持的可选的配置列表,您可以参考 MQTT 协议规范来获取更详尽的信息。
 
 - ClientId
 
@@ -122,10 +122,10 @@ EdgeX 消息总线类型,目前支持两种消息总线。如果指定了错
 
 ## 重载缺省设置
 
-在某些情况下,你可能想消费来自于多个主题的数据。Kuiper 支持指定别的配置,并且在创建流定义的时候使用 ``CONF_KEY`` 来指定新的配置。
+在某些情况下,你可能想消费来自于多个主题的数据。Kuiper 支持指定别的配置,并且在创建流定义的时候使用 `CONF_KEY` 来指定新的配置。
 
 ```yaml
-#Override the global configurations
+#覆盖全局配置
 demo1: #Conf_key
   protocol: tcp
   server: 10.211.55.6
@@ -133,7 +133,7 @@ demo1: #Conf_key
   topic: events
 ```
 
-如果你有个特定的源需要覆盖缺省的设置,你可以定义一个自定义的配置段。在上面的例子中,我们创建了一个新的配置 ``demo1``,然后你在创建流定义的时候可以使用选项 ``CONF_KEY`` 来使用新的配置 (参考 [流定义规范](../../sqls/streams.md) 获取更多详细信息)。
+如果你有个特定的源需要覆盖缺省的设置,你可以定义一个自定义的配置段。在上面的例子中,我们创建了一个新的配置 `demo1`,然后你在创建流定义的时候可以使用选项 `CONF_KEY` 来使用新的配置 (参考 [流定义规范](../../sqls/streams.md) 获取更多详细信息)。
 
 **例子**
 
@@ -141,5 +141,5 @@ demo1: #Conf_key
 create stream demo1() WITH (FORMAT="JSON", type="edgex", CONF_KEY="demo1");
 ```
 
-在自定义的配置中,能够使用的配置项与 ``default`` 部分的是一样的,任何在自定义段中设置的值将覆盖 ``default`` 部分里的配置。
+在自定义的配置中,能够使用的配置项与 `default` 部分的是一样的,任何在自定义段中设置的值将覆盖 `default` 部分里的配置。
 

+ 26 - 26
docs/zh_CN/rules/sources/http_pull.md

@@ -1,77 +1,77 @@
-# HTTP pull source 
+# HTTP 提取源
 
-Kuiper provides built-in support for pulling HTTP source stream, which can pull the message from HTTP server broker and feed into the Kuiper processing pipeline.  The configuration file of HTTP pull source is at ``etc/sources/httppull.yaml``. Below is the file format.
+Kuiper 为提取 HTTP 源流提供了内置支持,该支持可从 HTTP 服务器代理提取消息并输入 Kuiper 处理管道。 HTTP提取源的配置文件位于 `etc/sources/httppull.yaml`中。 以下是文件格式。
 
 ```yaml
-#Global httppull configurations
+#全局httppull配置
 default:
-  # url of the request server address
+  # 请求服务器地址的URL
   url: http://localhost
   # post, get, put, delete
   method: post
-  # The interval between the requests, time unit is ms
+  # 请求之间的间隔,时间单位为 ms
   interval: 10000
-  # The timeout for http request, time unit is ms
+  # http请求超时,时间单位为 ms
   timeout: 5000
-  # If it's set to true, then will compare with last result; If response of two requests are the same, then will skip sending out the result.
-  # The possible setting could be: true/false
+  # 如果将其设置为 true,则将与最后的结果进行比较; 如果两个请求的响应相同,则将跳过发送结果。
+  # 可能的设置可能是:true/false
   incremental: false
-  # The body of request, such as '{"data": "data", "method": 1}'
+  # 请求正文,例如'{"data": "data", "method": 1}'
   body: '{}'
-  # Body type, none|text|json|html|xml|javascript|form
+  # 正文类型, none|text|json|html|xml|javascript|form
   bodyType: json
-  # HTTP headers required for the request
+  # 请求所需的HTTP标头
   headers:
     Accept: application/json
 
-#Override the global configurations
+#重载全局配置
 application_conf: #Conf_key
   incremental: true
   url: http://localhost:9090/pull
 ```
 
-## Global HTTP pull configurations
+## 全局HTTP提取配置
 
-Use can specify the global HTTP pull settings here. The configuration items specified in ``default`` section will be taken as default settings for all HTTP connections. 
+用户可以在此处指定全局 HTTP 提取设置。 `default` 部分中指定的配置项将用作所有HTTP 连接的默认设置。
 
 ### url
 
-The URL where to get the result.
+获取结果的 URL。
 
 ### method
-HTTP method, it could be post, get, put & delete.
+HTTP 方法,它可以是 post、get、put 和 delete。
 
 ### interval
 
-The interval between the requests, time unit is ms.
+请求之间的间隔时间,单位为 ms。
 
 ### timeout
 
-The timeout for http request, time unit is ms.
+http 请求的超时时间,单位为 ms。
 
 ### incremental
 
-If it's set to true, then will compare with last result; If response of two requests are the same, then will skip sending out the result.
+如果将其设置为 true,则将与最后的结果进行比较; 如果两个请求的响应相同,则将跳过发送结果。
 
 ### body
 
-The body of request, such as `'{"data": "data", "method": 1}'`
+请求的正文, 例如 `{"data": "data", "method": 1}`
 
 ### bodyType
 
-Body type, it could be none|text|json|html|xml|javascript|form.
+正文类型,可以是 none|text|json|html|xml|javascript| 格式。
 
 ### headers
 
-The HTTP request headers that you want to send along with the HTTP request.
+需要与 HTTP 请求一起发送的 HTTP 请求标头。
 
 
 
-## Override the default settings
+## 重载默认设置
 
-If you have a specific connection that need to overwrite the default settings, you can create a customized section. In the previous sample, we create a specific setting named with ``application_conf``.  Then you can specify the configuration with option ``CONF_KEY`` when creating the stream definition (see [stream specs](../../sqls/streams.md) for more info).
+如果您有特定的连接需要重载默认设置,则可以创建一个自定义部分。 在上一个示例中,我们创建了一个名为 `application_conf` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [流规格](../../sqls/streams.md))。
 
-**Sample**
+**样例**
 
 ```
 demo (
@@ -79,5 +79,5 @@ demo (
 	) WITH (DATASOURCE="test/", FORMAT="JSON", TYPE="httppull", KEY="USERID", CONF_KEY="application_conf");
 ```
 
-The configuration keys used for these specific settings are the same as in ``default`` settings, any values specified in specific settings will overwrite the values in ``default`` section.
+这些特定设置所使用的配置键与 `default` 设置中的配置键相同,在特定设置中指定的任何值都将重载 `default` 部分中的值。
 

+ 14 - 14
docs/zh_CN/rules/sources/mqtt.md

@@ -1,9 +1,9 @@
 # MQTT源
 
-Kuiper为MQTT源流提供了内置支持,流可以订阅来自MQTT代理的消息并输入Kuiper处理管道。 MQTT源的配置文件位于``$ kuiper / etc / mqtt_source.yaml''。 以下是文件格式。
+Kuiper  MQTT 源流提供了内置支持,流可以订阅来自 MQTT 代理的消息并输入Kuiper 处理管道。 MQTT 源的配置文件位于 `$kuiper/etc/mqtt_source.yaml`。 以下是文件格式。
 
 ```yaml
-#Global MQTT configurations
+#全局MQTT配置
 default:
   qos: 1
   sharedsubscription: true
@@ -15,15 +15,15 @@ default:
   #privateKeyPath: /var/kuiper/xyz-private.pem.key
 
 
-#Override the global configurations
+#重载全局配置
 demo: #Conf_key
   qos: 0
   servers: [tcp://10.211.55.6:1883]
 ```
 
-## 全局MQTT配置
+## 全局 MQTT 配置
 
-用户可以在此处指定全局MQTT设置。 `默认'部分中指定的配置项将用作所有MQTT连接的默认设置。
+用户可以在此处指定全局 MQTT 设置。`default` 部分中指定的配置项将用作所有MQTT 连接的默认设置。
 
 ### qos
 
@@ -34,35 +34,35 @@ demo: #Conf_key
 
 ### sharedsubscription
 
-是否使用共享订阅模式。 如果使用共享订阅模式,那么多个Kuiper进程可以进行负载平衡。
+是否使用共享订阅模式。 如果使用共享订阅模式,那么多个 Kuiper 进程可以进行负载平衡。
 
 ### servers
 
-MQTT消息代理的服务器列表。 当前,只能指定一个服务器。
+MQTT 消息代理的服务器列表。 当前,只能指定一个服务器。
 
 ### username
 
-MQTT 连接用户名。如果指定了``certificationPath`` 或者 ``privateKeyPath``,那么该项配置不会被使用。
+MQTT 连接用户名。如果指定了 `certificationPath`  或者 `privateKeyPath`,那么该项配置不会被使用。
 
 ### password
 
-MQTT 连接密码。如果指定了``certificationPath`` 或者 ``privateKeyPath``,那么该项配置不会被使用。
+MQTT 连接密码。如果指定了 `certificationPath` 或者 `privateKeyPath`,那么该项配置不会被使用。
 
 ### certificationPath
 
-证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行``server``命令的路径。比如,如果你在``/var/kuiper`` 中运行 ``bin/server`` ,那么父目录为 ``/var/kuiper``; 如果运行从``/var/kuiper/bin``中运行``./server``,那么父目录为 ``/var/kuiper/bin``。 比如  ``d3807d9fa5-certificate.pem``.
+证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 `server` 命令的路径。比如,如果你在 `/var/kuiper` 中运行 `bin/server` ,那么父目录为 `/var/kuiper`; 如果运行从`/var/kuiper/bin`中运行`./server`,那么父目录为 `/var/kuiper/bin`。 比如  `d3807d9fa5-certificate.pem`。
 
 ### privateKeyPath
 
-私钥路径。可以为绝对路径,也可以为相对路径。更详细的信息,请参考 ``certificationPath``. 比如``d3807d9fa5-private.pem.key``.
+私钥路径。可以为绝对路径,也可以为相对路径。更详细的信息,请参考 `certificationPath`,比如 `d3807d9fa5-private.pem.key`。
 
 ### bufferLength
 
 指定最大缓存消息数目。该参数主要用于防止内存溢出。实际内存用量会根据当前缓存消息数目动态变化。增大该参数不会增加初始内存分配量,因此设置较大的数值是安全的。该参数默认值为102400;如果每条消息为100字节,则默认情况下,缓存最大占用内存量为102400 * 100B ~= 10MB. 
 
-## 覆盖默认设置
+## 重载默认设置
 
-如果您有一个特定连接需要覆盖默认设置,则可以创建一个自定义模块。 在上一个示例中,我们创建一个名为“ demo”的特定设置。 然后,您可以在创建流定义时使用选项“ CONF_KEY”指定配置(有关更多信息,请参见 [stream specs](../../sqls/streams.md) )。
+如果您有一个特定连接需要重载默认设置,则可以创建一个自定义模块。 在上一个示例中,我们创建一个名为 `demo` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [stream specs](../../sqls/streams.md) )。
 
 **示例**
 
@@ -72,5 +72,5 @@ demo (
 	) WITH (DATASOURCE="test/", FORMAT="JSON", KEY="USERID", CONF_KEY="demo");
 ```
 
-这些特定设置使用的配置键与“默认”设置中的配置键相同,在特定设置中指定的任何值都将覆盖“默认”部分中的值。
+这些特定设置使用的配置键与 `default` 设置中的配置键相同,在特定设置中指定的任何值都将覆盖 `default` 部分中的值。
 

+ 39 - 38
docs/zh_CN/sqls/built-in_functions.md

@@ -1,13 +1,13 @@
 # 函数
 
-Kuiper具有许多内置函数,可以对数据执行计算。
+Kuiper 具有许多内置函数,可以对数据执行计算。
 
 ## 聚合函数
 聚合函数对一组值执行计算并返回单个值。聚合函数只能用作以下表达式:
-* select语句的select列表(子查询或外部查询)。
-* HAVING子句。
+* select 语句的 select 列表(子查询或外部查询)。
+* HAVING 子句。
 
-| Function | Example   | 说明             |
+| 函数 | 示例 | 说明             |
 | -------- | --------- | ---------------- |
 | avg      | avg(col1) | 组中的平均值。空值不参与计算。     |
 | count    | count(*)  | 组中的项目数。空值不参与计算。    |
@@ -16,7 +16,7 @@ Kuiper具有许多内置函数,可以对数据执行计算。
 | sum      | sum(col1) | 组中所有值的总和。空值不参与计算。 |
 
 ## 数学函数
-| Function | Example     | Description                                    |
+| 函数 | 示例   | 说明                                  |
 | -------- | ----------- | ---------------------------------------------- |
 | abs      | abs(col1)   | 绝对值             |
 | acos     | acos(col1)  | 弧度数的反余弦值 |
@@ -34,9 +34,9 @@ Kuiper具有许多内置函数,可以对数据执行计算。
 | ln       | ln(col1)    | 返回参数的自然对数。 |
 | log      | log(col1)   | 返回参数的以10为底的对数。 |
 | mod      | mod(col1, col2)   | 返回第一个参数除以第二个参数的余数。                |
-| power    | power(x, y) | Pow returns x**y, the base-x exponential of y. |
+| power    | power(x, y) | 返回 x 的 y 次方。 |
 | rand     | rand()      | 返回一个伪随机数,其均匀分布在0.0和1.0之间。                     |
-| round    | round(col1) | 将值四舍五入到最接近的BIGINT值。 |
+| round    | round(col1) | 将值四舍五入到最接近的 BIGINT 值。 |
 | sign     | sign(col1)  | 返回给定数字的符号。 当参数的符号为正时,将返回1。 当参数的符号为负数时,返回-1。 如果参数为0,则返回0。 |
 | sin      | sin(col1)   | 返回弧度数的正弦值。 |
 | sinh     | sinh(col1)  | 返回弧度数的双曲正弦值。                                                     |
@@ -46,58 +46,59 @@ Kuiper具有许多内置函数,可以对数据执行计算。
 
 ## 字符串函数
 
-| Function | Example     | Description                                    |
+| 函数 | 示例   | 说明                                  |
 | -------- | ----------- | ---------------------------------------------- |
-| concat   | concat(col1...)  | 连接数组或字符串。 此函数接受任意数量的参数并返回String或Array |
-| endswith | endswith(col1, col2) | 返回一个布尔值,该布尔值指示第一个String参数是否以第二个String参数结尾。 |
+| concat   | concat(col1...)  | 连接数组或字符串。 此函数接受任意数量的参数并返回 String  Array |
+| endswith | endswith(col1, col2) | 返回一个布尔值,该布尔值指示第一个 String参数是否以第二个 String 参数结尾。 |
 | format_time| parse_time(col1, format) | 将日期时间格式化为字符串。 |
 | indexof  | indexof(col1, col2)  | 返回第二个参数的第一个索引(从0开始),作为第一个参数中的子字符串。 |
 | length   | length(col1)| 返回提供的字符串中的字符数。                                                    |
-| lower    | lower(col1) | 返回给定String的小写版本。                                                         |
-| lpad     | lpad(col1, 2) | 返回String参数,在左侧用第二个参数指定的空格数填充。 |
+| lower    | lower(col1) | 返回给定 String 的小写版本。                                                       |
+| lpad     | lpad(col1, 2) | 返回 String,在左侧用第二个参数指定的空格数填充。 |
 | ltrim    | ltrim(col1) | 从提供的字符串中删除所有前导空格(制表符和空格)。                       |
-| numbytes | numbytes(col1) | 以提供的字符串的UTF-8编码返回字节数。                    |
-| regexp_matches| regexp_matches(col1, regex) | 如果字符串(第一个参数)包含正则表达式的匹配项,则返回true。 |
+| numbytes | numbytes(col1) | 以提供的字符串的 UTF-8 编码返回字节数。                  |
+| regexp_matches| regexp_matches(col1, regex) | 如果字符串(第一个参数)包含正则表达式的匹配项,则返回 true。 |
 | regexp_replace| regexp_matches(col1, regex, str) | 将第一个参数中所有出现的第二个参数(正则表达式)替换为第三个参数。                         |
 | regexp_substr| regexp_substr(col1, regex) | 在第一个参数中找到第二个参数(regex)的第一个匹配项。 |
 | rpad     | rpad(col1, 2) | 返回字符串参数,在右侧填充第二个参数指定的空格数。 |
 | rtrim    | rtrim(col1) | 从提供的字符串中删除所有尾随空白(制表符和空格)。                       |
-| substring| substring(col1, start, end) |  从提供的Int索引(从0开始,包括0)到字符串的结尾,返回提供的String的子字符串。               |
+| substring| substring(col1, start, end) |  从提供的 Int 索引(从0开始,包括0)到字符串的结尾,返回提供的String的子字符串。             |
 | startswith| startswith(col1, str) | 返回布尔值,是否第一个字符串参数是否以第二个字符串参数开头。 |
 | trim      | trim(col1) | 从提供的字符串中删除所有前导和尾随空格(制表符和空格)。        |
-| upper     | upper(col1)| 返回给定String的大写版本。 |
+| upper     | upper(col1)| 返回给定 String 的大写版本。 |
 
 ## 转换函数
 
-| Function | 示例     | Description                                    |
+| 函数 | 示例     | 说明                                  |
 | -------- | ----------- | ---------------------------------------------- |
-| cast     | cast(col,  "bigint") | 将值从一种数据类型转换为另一种数据类型。 支持的类型包括:bigint,float,string,boolean和datetime(现在不支持)。 |
-| chr      | chr(col1)   | 返回与给定Int参数对应的ASCII字符                               |
-| encode   | encode(col1, "base64") |使用encode函数根据编码方案将负载(可能是非JSON数据)编码为其字符串表示形式。目前,只支持“base64”econding类型。                             |
+| cast     | cast(col,  "bigint") | 将值从一种数据类型转换为另一种数据类型。 支持的类型包括:bigint,float,string,boolean  datetime(现在不支持)。 |
+| chr      | chr(col1)   | 返回与给定 Int 参数对应的 ASCII 字符                           |
+| encode   | encode(col1, "base64") |使用 encode 函数根据编码方案将负载(可能是非 JSON 数据)编码为其字符串表示形式。目前,只支持"base64"econding 类型。                             |
 | trunc    | trunc(dec, int)| 将第一个参数截断为第二个参数指定的小数位数。 如果第二个参数小于零,则将其设置为零。 如果第二个参数大于34,则将其设置为34。从结果中去除尾随零。 |
 
 ## 哈希函数
-| Function | Example      | 说明         |
-| -------- | ------------ | ------------ |
-| md5      | md5(col1)    | 参数的哈希值 |
-| sha1     | sha1(col1)   | 参数的哈希值 |
-| sha256   | sha256(col1) | 参数的哈希值 |
-| sha384   | sha384(col1) | 参数的哈希值 |
-| sha512   | sha512(col1) | 参数的哈希值 |
+| 函数   | 示例         | 说明         |
+| ------ | ------------ | ------------ |
+| md5    | md5(col1)    | 参数的哈希值 |
+| sha1   | sha1(col1)   | 参数的哈希值 |
+| sha256 | sha256(col1) | 参数的哈希值 |
+| sha384 | sha384(col1) | 参数的哈希值 |
+| sha512 | sha512(col1) | 参数的哈希值 |
 
-## JSON Functions
-| Function | Example     | Description                                    |
+## JSON 函数
+| 函数 | 示例   | 说明                                |
 | -------- | ----------- | ---------------------------------------------- |
-| json_path_exists      | json_path_exists(col1, "$.name")   | Checks whether JSON path returns any item for the specified JSON value. Return bool value.                   |
-| json_path_query     | json_path_query(col1, "$.name")  | Gets all items returned by JSON path for the specified JSON value.              |
-| json_path_query_first  | json_path_query_first(col1, "$.name")| Gets the first item returned by JSON path for the specified JSON value.                  |
+| json_path_exists      | json_path_exists(col1, "$.name")   | 检查 JSON 路径是否返回指定JSON 值的任何项目。 返回布尔值。 |
+| json_path_query     | json_path_query(col1, "$.name")  | 获取 JSON 路径返回的指定 JSON值的所有项目。 |
+| json_path_query_first  | json_path_query_first(col1, "$.name")| 获取 JSON 路径返回的指定 JSON值的第一项。 |
+
+**请参阅 [json 路径函数](../json_expr.md#json-path-functions) 了解如何编写json路径。**
 
-**Please refer to [json path functions](../json_expr.md#json-path-functions) for how to compose a json path.**  
 ## 其它函数
-| 函数    | 示例         | Description                                                  |
+| 函数    | 示例         | 说明                                                         |
 | ------- | ------------ | ------------------------------------------------------------ |
-| isNull  | isNull(col1) | 如果参数为空值,则返回true。                                 |
-| newuuid | newuuid()    | 返回一个随机的16字节UUID。                                   |
+| isNull  | isNull(col1) | 如果参数为空值,则返回 true。                                |
+| newuuid | newuuid()    | 返回一个随机的16字节 UUID。                                  |
 | tstamp  | tstamp()     | 返回当前时间戳,以1970年1月1日星期四00:00:00协调世界时(UTC)为单位。 |
-| mqtt    | mqtt(topic)  | Returns the MQTT meta-data of specified key. The current supported keys<br />- topic: return the topic of message.  If there are multiple stream source, then specify the source name in parameter. Such as ``mqtt(src1.topic)``<br />- messageid: return the message id of message. If there are multiple stream source, then specify the source name in parameter. Such as ``mqtt(src2.messageid)`` |
-| meta    | meta(topic)  | Returns the meta-data of specified key. The key could be:<br/> - a standalone key if there is only one source in the from clause, such as ``meta(device)``<br />- A qualified key to specify the stream, such as ``meta(src1.device)`` <br />- A key with arrow for multi level meta data, such as ``meta(src1.reading->device->name)`` This assumes reading is a map structure meta data. |
+| mqtt    | mqtt(topic)  | 返回指定键的 MQTT 元数据。 当前支持的键包括<br />-topic:返回消息的主题。 如果有多个流源,则在参数中指定源名称。 如 `mqtt(src1.topic)`<br />- messageid:返回消息的消息ID。 如果有多个流源,则在参数中指定源名称。 如 `mqtt(src2.messageid)` |
+| meta    | meta(topic)  | 返回指定键的元数据。 键可能是:<br/>-如果 from 子句中只有一个来源,则为独立键,例如`meta(device)`<br />-用于指定流的合格键,例如 `meta(src1.device)` <br />-用于多级元数据的带有箭头的键,例如 `meta(src1.reading->device->name)`。这里假定读取是地图结构元数据。 |

+ 30 - 10
docs/zh_CN/sqls/data_types.md

@@ -1,6 +1,6 @@
 # 数据类型
 
-在Kuiper中,每个列或表达式都有一个相关的数据类型。 数据类型描述(并约束)该类型的列可以容纳的一组值或可以产生的一组表达式。
+在 Kuiper 中,每个列或表达式都有一个相关的数据类型。 数据类型描述(并约束)该类型的列可以容纳的一组值或可以产生的一组表达式。
 
 
 
@@ -8,17 +8,37 @@
 
 以下是支持的数据类型的列表。
 
-| #    | Data type | Description                                                  |
-| ---- | --------- | ------------------------------------------------------------ |
-| 1    | bigint    | The int type.                                                |
-| 2    | float     | 浮点型                                                       |
-| 3    | string    | 文本值,由Unicode字符组成。                                  |
-| 4    | datetime  | 日期时间类型-*目前尚不支持*。                                |
-| 5    | boolean   | 布尔类型,值可以是“ true”或“ false”。                        |
-| 6    | array     | 数组类型可以是简单数据或结构类型中的任何类型(#1-#5和#7)。 |
-| 7    | struct    | 复杂类型。 名称/值对的集合。 值必须是受支持的数据类型。      |
+| #    | 数据类型 | 描述                                                         |
+| ---- | -------- | ------------------------------------------------------------ |
+| 1    | bigint   | 整数型                                                       |
+| 2    | float    | 浮点型                                                       |
+| 3    | string   | 文本值,由 Unicode 字符组成。                                |
+| 4    | datetime | 日期时间类型-*目前尚不支持*。                                |
+| 5    | boolean  | 布尔类型,值可以是`true` 或者 `false`。                      |
+| 6    | array    | 数组类型可以是简单数据或结构类型中的任何类型(#1-#5和#7)。 |
+| 7    | struct   | 复杂类型。 名称/值对的集合。 值必须是受支持的数据类型。      |
 
+## 比较和计算的兼容性
 
+每个 sql 子句中可能都有二进制操作。 在此示例中,` Select temperature * 2 from demo where temperature > 20`,在 select 子句中使用计算操作,在 where 子句中使用比较操作。 在二进制操作中,如果使用了不兼容的数据类型,则会发生运行时错误并将其发送到目标。
+
+数组和结构在任何二进制操作中均不受支持。 下表列出了其他数据类型的兼容性。 而行标题是左操作数数据类型,列标题是右操作数数据。 关于兼容性的值,其中 Y 表示是,N 表示否。
+
+ #    | bigint | float | string | datetime | boolean |
+
+ ---- | ------ | ----  | ----   | ----     | ---     |
+ bigint|  Y    |  Y    |   N    |   N      |   N     |
+ float |  Y    |  Y    |   N    |   N      |   N     |
+ string|  N    |  N    |   Y    |   N      |   N     |
+ datetime| Y   |  Y    | Y if in the valid format | Y | N |
+ boolean| N    |  N    |   N    |   N      |   N     |
+
+日期时间字符串的默认格式是 `"2006-01-02T15:04:05.000Z07:00"`
+
+对于 `nil` 值,我们遵循以下规则:
+
+  1. 与 nil 比较总是返回 false
+  2. 用 nil 计算总是返回 nil
 
 ## 类型转换
 

+ 3 - 3
docs/zh_CN/sqls/json_expr.md

@@ -37,7 +37,7 @@
 
 源引用(`.`)
 
-源引用运算符可用于通过引用源流或表来指定列。 ``->``引用选择嵌套JSON对象中的键。
+源引用运算符可用于通过引用源流或表来指定列。 `->` 引用选择嵌套 JSON 对象中的键。
 
 ```
 SELECT demo.age FROM demo
@@ -90,7 +90,7 @@ SELECT d.friends[0]->last FROM demo AS d
 
 切片允许您选择数组的连续子集。
 
-``field[from:to]`` 如果未指定from,则表示从数组的第一个元素开始; 如果未指定to,则表示以数组的最后一个元素结尾。
+`field[from:to]` 如果未指定 from,则表示从数组的第一个元素开始; 如果未指定 to,则表示以数组的最后一个元素结尾。
 
 ```
 SELECT children[0:1] FROM demo
@@ -136,7 +136,7 @@ SELECT followers->Group1[:1]->first FROM demo
 
 #### 列表和切片映射
 
-通配符表达式创建列表映射,它是JSON数组上的映射。
+通配符表达式创建列表映射,它是 JSON 数组上的映射。
 
 ```
 SELECT demo.friends[*]->first FROM demo

+ 24 - 24
docs/zh_CN/sqls/lexical_elements.md

@@ -1,52 +1,52 @@
-# Kuiper lexical elements
+# Kuiper 词汇元素
 
-## Comments
+## 注释
 
-Comment serve as documentation. Comments begin with the character sequence `/*` and stop at the pair `*/`.
+注释被当作文档。 注释以字符序列 `/*` 开始,并终止于对应的 `*/`。
 
-## Tokens
+## 令牌(Tokens
 
-Kuiper SQL is built up from tokens. There are four classes of tokens:
+Kuiper SQL 由令牌构建。 令牌分为四类:
 
-- *identifiers*
-- *keywords*
-- *operators*
-- *literals*
+- *标识符*
+- *关键字*
+- *运算符*
+- *字面量*
 
-*White space* formed from spaces, horizontal tabs, carriage returns, and newlines is ignored except as it separates tokens that would otherwise combine into a single token. While breaking the input into tokens, the next token is the longest sequence of characters that form a valid token.
+由空格、水平制表符、回车符和换行符组成的*空白符*将被忽略,除非它将分隔的令牌分开,否则这些令牌会合并为一个令牌。在将输入分成令牌时,下一个令牌是形成有效令牌的最长字符序列。
 
-## Identifiers
+##  标识符(Identifiers
 
-Identifiers name entities within a program. An *identifier* is a sequence of one or more letters and digits. An identifier must start with a letter. 
+程序中的标识符命名实体。*标识符*是一个或多个字母和数字的序列。 标识符必须以字母开头。
 
-To use the reserved words as the column name and the stream name etc, they need to be quoted by backtick. You can also use all kinds of unicode string in the backtick as an SQL element. For example, operator `-`, spaces, and various language characters such as Chinese.
+如果要将保留字用作列名和流名等,它们必须用 反撇号将其括起来。 您还可以在反引号中使用各种 unicode 字符串作为 SQL 元素。 例如,运算符 `-`,空格和各种语言字符(例如中文)。
 
 ```sql
 SELECT `select`, `and` from demo
 SELECT `a-b`, `hello world`, `中文Chinese` from demo
 ```
 
-## Keywords
+## 关键字(Keywords
 
-**Reserved keywords for rule SQL**: If you'd like to use the following keyword in rule SQL, you will have to use backtick to enclose them.
+**规则 SQL 的保留关键字**:如果您想在规则 SQL 中使用以下关键字,则必须使用反撇号将其括起来。
 
 ```
 SELECT, FROM, JOIN, LEFT, INNER, ON, WHERE, GROUP, ORDER, HAVING, BY, ASC, DESC, AND, OR
 ```
 
-The following is an example for using a stream named `from`, which is a reserved keyword in Kuiper.
+以下是使用名为 `from` 的流的示例,`from` 是 Kuiper 中的保留关键字。
 
 ```sql
 SELECT * FROM demo1 where `from`="device1"
 ```
 
-**Reserved keywords for streams management**: If you'd like to use the following keywords in stream management command, you will have to use backtick to enclose them.
+**用于流管理的保留关键字**:如果您想在流管理命令中使用以下关键字,则必须使用反撇号将其括起来。
 
 ```
 CREATE, RROP, EXPLAIN, DESCRIBE, SHOW, STREAM, STREAMS, WITH, BIGINT, FLOAT, STRING, DATETIME, BOOLEAN, ARRAY, STRUCT, DATASOURCE, KEY, FORMAT,CONF_KEY, TYPE, STRICT_VALIDATION, TIMESTAMP, TIMESTAMP_FORMAT
 ```
 
-The following is an example for how to use reserved keywords in stream creation statement.
+以下是如何在流创建语句中使用保留关键字的示例。
 
 ```sql
 CREATE STREAM `stream` (
@@ -59,25 +59,25 @@ CREATE STREAM `stream` (
 				) WITH (DATASOURCE="users", FORMAT="JSON");
 ```
 
-## Operators
+## 运算法(Operators
 
-Following operators are provided.
+提供了以下运算符。
 
 ```
 +, -, *, /, %, &, |, ^, =, !=, <, <=, >, >=, [], ->, ()
 ```
 
-## Literals
+## 字面量(Literals
 
-**Boolean literals**
+**布尔字面量**
 
 ```
 TRUE, FALSE
 ```
 
-Example, ` SELECT TRUE AS field1 FROM demo` , the field `field1` always returns `true`.
+例如, ` SELECT TRUE AS field1 FROM demo` ,  `field1`字段 总是返回 `true`.
 
-**Time literals**: Below literals are used in time window, which identify the time unit for windows.
+**时间字面量**: 下面的字面量在时间窗口中使用,用于标识窗口的时间单位。
 
 ```
 DD, HH, MI, SS, MS

+ 1 - 1
docs/zh_CN/sqls/overview.md

@@ -1,4 +1,4 @@
-Kuiper提供了一种类似于SQL的查询语言,用于对事件流执行转换和计算。 本文介绍Kuiper查询语言的语法、用法和最佳实践。
+Kuiper 提供了一种类似于 SQL 的查询语言,用于对事件流执行转换和计算。 本文介绍Kuiper 查询语言的语法、用法和最佳实践。
 
 - [流规格](streams.md)
 

+ 26 - 26
docs/zh_CN/sqls/query_language_elements.md

@@ -1,22 +1,22 @@
 
 # 查询语言元素
 
-Kuiper提供了用于构建查询的各种元素。 总结如下。
+Kuiper 提供了用于构建查询的各种元素。 总结如下。
 
 | 元素                  | 总结                                                         |
 | --------------------- | ------------------------------------------------------------ |
-| [SELECT](#SELECT)     | SELECT用于从输入流中检索行,并允许从Kuiper中的一个或多个输入流中选择一个或多个列。 |
-| [FROM](#FROM)         | FROM指定输入流。 任何SELECT语句始终需要FROM子句。            |
-| [JOIN](#JOIN)         | JOIN用于合并来自两个或更多输入流的记录。 JOIN包括LEFT,RIGHT,FULL和CROSS。 |
-| [WHERE](#WHERE)       | WHERE指定查询返回的行的搜索条件。                            |
-| [GROUP BY](#GROUP BY) | GROUP BY将一组选定的行分组为一组汇总行,这些汇总行按一个或多个列或表达式的值分组。 |
+| [SELECT](#SELECT)     | SELECT 用于从输入流中检索行,并允许从 Kuiper 中的一个或多个输入流中选择一个或多个列。 |
+| [FROM](#FROM)         | FROM 指定输入流。 任何 SELECT 语句始终需要 FROM 子句。       |
+| [JOIN](#JOIN)         | JOIN 用于合并来自两个或更多输入流的记录。 JOIN 包括 LEFT,RIGHT,FULL  CROSS。 |
+| [WHERE](#WHERE)       | WHERE 指定查询返回的行的搜索条件。                           |
+| [GROUP BY](#GROUP BY) | GROUP BY 将一组选定的行分组为一组汇总行,这些汇总行按一个或多个列或表达式的值分组。 |
 | [ORDER BY](#ORDER BY) | 按一列或多列的值对行进行排序。                               |
-| [HAVING](#HAVING)     | HAVING为组或集合指定搜索条件。 HAVING只能与SELECT表达式一起使用。 |
+| [HAVING](#HAVING)     | HAVING 为组或集合指定搜索条件。 HAVING 只能与 SELECT 表达式一起使用。 |
 |                       |                                                              |
 
 ## SELECT
 
-从输入流中检索行,并允许从Kuiper中的一个或多个输入流中选择一个或多个列。
+从输入流中检索行,并允许从 Kuiper 中的一个或多个输入流中选择一个或多个列。
 
 ### 句法
 
@@ -30,7 +30,7 @@ SELECT
 
 ### 参数
 
-指定应返回FROM子句中所有输入流的所有列。 列由输入源返回,如FROM子句中指定的那样,并按它们在传入流中存在的顺序或由ORDER BY子句指定的顺序返回。
+指定应返回 FROM 子句中所有输入流的所有列。 列由输入源返回,如 FROM 子句中指定的那样,并按它们在传入流中存在的顺序或由 ORDER BY 子句指定的顺序返回。
 
 **\***
 
@@ -46,7 +46,7 @@ SELECT
 
 **column_alias**
 
-用替代名称替换查询结果集中的列名称。 别名还用于指定表达式结果的名称。column_alias不能在WHERE、GROUP BY或HAVING子句中使用。
+用替代名称替换查询结果集中的列名称。 别名还用于指定表达式结果的名称。column_alias 不能在 WHERE、GROUP BY  HAVING 子句中使用。
 
 **表达式**
 
@@ -54,7 +54,7 @@ SELECT
 
 ## FROM
 
-指定输入流。 任何SELECT语句始终需要FROM子句。
+指定输入流。 任何 SELECT 语句始终需要 FROM 子句。
 
 ### Syntax
 
@@ -70,7 +70,7 @@ FROM source_stream | source_stream AS source_stream_alias
 
 ## JOIN
 
-JOIN用于合并来自两个或更多输入流的记录。 JOIN包括LEFT,RIGHT,FULL和CROSS。
+JOIN 用于合并来自两个或更多输入流的记录。 JOIN 包括 LEFT,RIGHT,FULL 和CROSS。
 
 ### 句法
 
@@ -85,7 +85,7 @@ ON <source_stream|source_stream_alias>.column_name =<source_stream|source_stream
 
 **LEFT**
 
-LEFT JOIN关键字从左流(stream1)返回所有记录,并从右流(stream2)返回匹配的记录。 如果不匹配,则结果从右侧为NULL。
+LEFT JOIN 关键字从左流(stream1)返回所有记录,并从右流(stream2)返回匹配的记录。 如果不匹配,则结果从右侧为 NULL。
 
 ```sql
 SELECT column_name(s)
@@ -96,7 +96,7 @@ ON stream1.column_name = stream2.column_name;
 
 **RIGHT**
 
-JOIN关键字从右侧流(stream2)返回所有记录,并从左侧流(stream1)返回匹配的记录。 如果没有匹配项,则结果从左侧为NULL。
+JOIN 关键字从右侧流(stream2)返回所有记录,并从左侧流(stream1)返回匹配的记录。 如果没有匹配项,则结果从左侧为 NULL。
 
 ```sql
 SELECT column_name(s)
@@ -107,9 +107,9 @@ ON stream1.column_name = stream2.column_name;
 
 **FULL**
 
-当左(stream1)或右(stream2)表记录匹配时,FULL JOIN关键字返回所有记录。
+当左(stream1)或右(stream2)表记录匹配时,FULL JOIN 关键字返回所有记录。
 
-**注意:** FULL JOIN可能返回较大的结果集!
+**注意:** FULL JOIN 可能返回较大的结果集!
 
 ```sql
 SELECT column_name(s)
@@ -121,9 +121,9 @@ WHERE condition;
 
 **CROSS**
 
-CROSS JOIN用于将第一个流(stream1)的每一行与第二个流(stream2)的每一行组合。 这也称为笛卡尔联接,因为它从联接表返回行集的笛卡尔乘积。 假设在stream1中有m 行,在stream2中有 n 行,那么CROSS JOIN的结果将返回m * n 行。
+CROSS JOIN 用于将第一个流(stream1)的每一行与第二个流(stream2)的每一行组合。 这也称为笛卡尔联接,因为它从联接表返回行集的笛卡尔乘积。 假设在 stream1中有 m 行,在stream2 中有 n 行,那么 CROSS JOIN 的结果将返回 m * n 行。
 
-**注意:** CROSS JOIN可能返回非常大的结果集!
+**注意:** CROSS JOIN 可能返回非常大的结果集!
 
 ```sql
 SELECT column_name(s)
@@ -143,7 +143,7 @@ WHERE condition;
 
 ## WHERE
 
-WHERE指定查询返回的行的搜索条件。 WHERE子句仅用于提取满足指定条件的那些记录。
+WHERE 指定查询返回的行的搜索条件。 WHERE 子句仅用于提取满足指定条件的那些记录。
 
 ### 句法
 
@@ -175,11 +175,11 @@ WHERE <search_condition>
 
 **< predicate >**
 
-返回TRUE或FALSE的表达式。
+返回 TRUE  FALSE 的表达式。
 
 **表达式**
 
-是列名、常数、函数、变量、标量子查询,或由一个或多个运算符或子查询连接的列名、常数和函数的任意组合。表达式也可以包含CASE表达式。
+是列名、常数、函数、变量、标量子查询,或由一个或多个运算符或子查询连接的列名、常数和函数的任意组合。表达式也可以包含 CASE 表达式。
 
 **=**
 
@@ -219,7 +219,7 @@ WHERE condition;
 
 ## GROUP BY
 
-GROUP BY将一组选定的行分组为一组汇总行,这些汇总行按一个或多个列或表达式的值分组。
+GROUP BY 将一组选定的行分组为一组汇总行,这些汇总行按一个或多个列或表达式的值分组。
 
 ### 句法
 
@@ -252,7 +252,7 @@ GROUP BY column_name
 
 ### HAVING
 
-指定组或集合的搜索条件。 HAVING只能与SELECT表达式一起使用。 HAVING通常在GROUP BY子句中使用。 如果不使用GROUP BY,则HAVING的行为类似于WHERE子句。
+指定组或集合的搜索条件。 HAVING 只能与 SELECT 表达式一起使用。 HAVING 通常在 GROUP BY 子句中使用。 如果不使用 GROUP BY,则 HAVING 的行为类似于WHERE 子句。
 
 #### 句法
 
@@ -280,10 +280,10 @@ SELECT temp AS t, name FROM topic/sensor1 WHERE name = "dname" GROUP BY name HAV
 ORDER BY column1, column2, ... ASC|DESC
 ```
 
-sql中的ORDER BY语句用于根据一个或多个列对获取的数据进行升序或降序排序。
+sql 中的 ORDER BY 语句用于根据一个或多个列对获取的数据进行升序或降序排序。
 
-- 默认情况下,ORDER BY以**升序对数据进行排序。**
-- 关键字DESC用于按降序排序数据,关键字ASC用于按升序排序。
+- 默认情况下,ORDER BY 以**升序对数据进行排序。**
+- 关键字 DESC 用于按降序排序数据,关键字 ASC 用于按升序排序。
 
 ### 参数
 

+ 27 - 15
docs/zh_CN/sqls/streams.md

@@ -4,7 +4,7 @@
 
 
 
-在Kuiper中,每个列或表达式都有一个相关的数据类型。 数据类型描述(约束)该类型的列可以容纳的一组值或该类型可以产生的表达式。
+在 Kuiper 中,每个列或表达式都有一个相关的数据类型。 数据类型描述(约束)该类型的列可以容纳的一组值或该类型可以产生的表达式。
 
 以下是支持的数据类型的列表。
 
@@ -16,7 +16,7 @@
 | 4    | datetime | 不支持                                                 |
 | 5    | boolean  |                                                        |
 | 6    | array    | 数组类型可以是任何简单类型或结构类型(#1-#5和#7)。 |
-| 7    | struct   | The complex type.                                      |
+| 7    | struct   | 复杂类型                                               |
 
 ## 语言定义
 
@@ -29,14 +29,14 @@ CREATE STREAM
 
 **支持的属性名称**
 
-| Property name | Optional | Description                                                  |
+| 属性名称 | 是否可选 | 说明                                              |
 | ------------- | -------- | ------------------------------------------------------------ |
-| DATASOURCE | 否   | MQTT数据源主题名称列表。 |
-| FORMAT        | 否       | JSON. |
-| KEY           | true     | 保留键,当前未使用该字段。 它将用于GROUP BY语句。 |
-| TYPE    | 否       | 数据格式,当前值只能是“ JSON”。 |
-| StrictValidation     | 否   | 针对流模式控制消息字段的验证行为。 有关更多信息,请参见[StrictValidation](#StrictValidation) |
-| CONF_KEY | 否 | 如果需要配置其他配置项,请在此处指定config键。 有关更多信息,请参见 [MQTT stream](../rules/sources/mqtt.md) 。 |
+| DATASOURCE | 否   | MQTT 数据源主题名称列表。 |
+| FORMAT        | 否       | JSON |
+| KEY           |     | 保留键,当前未使用该字段。 它将用于 GROUP BY 语句。 |
+| TYPE    | 否       | 数据格式,当前值只能是 "JSON"。 |
+| StrictValidation     | 否   | 针对流模式控制消息字段的验证行为。 有关更多信息,请参见 [StrictValidation](#StrictValidation) |
+| CONF_KEY | 否 | 如果需要配置其他配置项,请在此处指定 config 键。 有关更多信息,请参见 [MQTT stream](../rules/sources/mqtt.md) 。 |
 
 **示例1**
 
@@ -46,7 +46,7 @@ my_stream
 WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id");
 ```
 
-该流将订阅MQTT主题topic / temperature,服务器连接使用配置文件``$ kuiper / etc / mqtt_source.yaml''中默认部分的servers键。
+该流将订阅 MQTT 主题`topic/temperature`,服务器连接使用配置文件`$kuiper/etc/mqtt_source.yaml` 中默认部分的 servers 键。
 
 - 有关更多信息,请参见 [MQTT source](../rules/sources/mqtt.md) 
 
@@ -63,7 +63,7 @@ demo (
 	) WITH (DATASOURCE="test/", FORMAT="JSON", KEY="USERID", CONF_KEY="demo");
 ```
 
- 流将订阅MQTT主题test /,服务器连接使用配置文件$ kuiper / etc / mqtt_source.yaml中demo部分的设置。
+ 流将订阅 MQTT 主题 `test/`,服务器连接使用配置文件`$kuiper/etc/mqtt_source.yaml`  demo 部分的设置。
 
 - 有关更多信息,请参见 [MQTT source](../rules/sources/mqtt.md) 
 
@@ -72,9 +72,9 @@ demo (
 ### StrictValidation
 
 ```
-The value of StrictValidation can be true or false.
-1) True: Drop the message if the message  is not satisfy with the stream definition.
-2) False: Keep the message, but fill the missing field with default empty value.
+StrictValidation 的值可以为 true 或 false。
+1)True:如果消息不符合流定义,则删除消息。
+2)False:保留消息,但用默认的空值填充缺少的字段。
 
 bigint: 0
 float: 0.0
@@ -85,5 +85,17 @@ array: zero length array
 struct: null value
 ```
 
-有关SQL语言的更多信息,请参见 [Query languange element](query_language_elements.md) 。
+### Schema-less 流
+
+如果流的数据类型未知或不同,我们可以不使用字段来定义它。 这称为 schema-less。 通过将字段设置为空来定义它。
+
+```sql
+schemaless_stream 
+  ()
+WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id");
+```
+
+Schema-less 流字段数据类型将在运行时确定。 如果在不兼容子句中使用该字段,则会抛出运行时错误并将其发送到目标。 例如,`where temperature > 30`。 一旦温度不是数字,将错误发送到目标。
+
+有关 SQL 语言的更多信息,请参见 [查询语言元素](query_language_elements.md) 。
 

+ 14 - 38
docs/zh_CN/sqls/windows.md

@@ -1,14 +1,14 @@
 # 窗口
 
-在时间流场景中,对时态窗口中包含的数据执行操作是一种常见的模式。Kuiper对窗口函数提供本机支持,使您能够以最小的工作量编写复杂的流处理作业。
+在时间流场景中,对时态窗口中包含的数据执行操作是一种常见的模式。Kuiper 对窗口函数提供本机支持,使您能够以最小的工作量编写复杂的流处理作业。
 
-有五种窗口可供使用: [滚动窗口](#TUMBLING WINDOW), [跳跃窗口](#Hopping window),[滑动窗口][Sliding window],[会话窗口](#Session window)和[计数窗口](#计数窗口)。 您可以在Kuiper查询的查询语法的GROUP BY子句中使用窗口函数。
+有五种窗口可供使用: [滚动窗口](#TUMBLING WINDOW), [跳跃窗口](#Hopping window),[滑动窗口][Sliding window],[会话窗口](#Session window)和[计数窗口](#计数窗口)。 您可以在 Kuiper 查询的查询语法的 GROUP BY 子句中使用窗口函数。
 
 所有窗口操作都在窗口的末尾输出结果。窗口的输出将是基于所用聚合函数的单个事件。
 
 ## 时间单位
 
-窗口中可以使用5个时间单位。 例如,``TUMBLINGWINDOW(ss,10)'',这意味着以10秒为间隔的滚动将数据分组。
+窗口中可以使用5个时间单位。 例如,`TUMBLINGWINDOW(ss,10)`,这意味着以10秒为间隔的滚动将数据分组。
 
 DD:天单位
 
@@ -26,28 +26,16 @@ MS :毫秒单位
 
 ![Tumbling Window](resources/tumblingWindow.png)
 
-待办事项: 
-
-- 是否需要时间戳?
-- 不支持计数功能。21
-
-
-
 ```sql
 SELECT count(*) FROM demo GROUP BY ID, TUMBLINGWINDOW(ss, 10);
 ```
 
 ## 跳跃窗口
 
-跳跃窗口功能会在时间上向前跳一段固定的时间。 将它们视为可能重叠的翻转窗口可能很容易,因此事件可以属于多个跳跃窗口结果集。 要使跳跃窗口与翻转窗口相同,请将跳跃大小指定为与窗口大小相同。
+跳跃窗口功能会在时间上向前跳一段固定的时间。 将它们视为可能重叠的翻转窗口可能很容易,因此事件可以属于多个跳跃窗口结果集。 要使跳跃窗口与翻转窗口相同,请将跳跃大小指定为与窗口大小相同。
 
 ![Hopping Window](resources/hoppingWindow.png)
 
-待办事项: 
-
-- 是否需要时间戳?
-- 不支持计数功能。
-
 ```sql
 SELECT count(*) FROM demo GROUP BY ID, HOPPINGWINDOW(ss, 10, 5);
 ```
@@ -60,11 +48,6 @@ SELECT count(*) FROM demo GROUP BY ID, HOPPINGWINDOW(ss, 10, 5);
 
 ![Sliding Window](resources/slidingWindow.png)
 
-待办事项: 
-
-- 是否需要时间戳?
-- 不支持计数功能。
-
 ```sql
 SELECT count(*) FROM demo GROUP BY ID, SLIDINGWINDOW(mm, 1);
 ```
@@ -77,13 +60,6 @@ SELECT count(*) FROM demo GROUP BY ID, SLIDINGWINDOW(mm, 1);
 
 ![Session Window](resources/sessionWindow.png)
 
-待办事项: 
-
-- 是否需要时间戳?
-- 不支持计数功能。
-
-
-
 ```sql
 SELECT count(*) FROM demo GROUP BY ID, SESSIONWINDOW(mm, 2, 1);
 ```
@@ -92,7 +68,7 @@ SELECT count(*) FROM demo GROUP BY ID, SESSIONWINDOW(mm, 2, 1);
 
 当第一个事件发生时,会话窗口开始。 如果从上一次摄取的事件起在指定的超时时间内发生了另一个事件,则窗口将扩展为包括新事件。 否则,如果在超时时间内未发生任何事件,则该窗口将在超时时关闭。
 
-如果事件在指定的超时时间内持续发生,则会话窗口将继续扩展直到达到最大持续时间。 最大持续时间检查间隔设置为与指定的最大持续时间相同的大小。 例如,如果最大持续时间为10,则检查窗口是否超过最大持续时间将在t = 0、10、20、30等处进行。
+如果事件在指定的超时时间内持续发生,则会话窗口将继续扩展直到达到最大持续时间。 最大持续时间检查间隔设置为与指定的最大持续时间相同的大小。 例如,如果最大持续时间为10,则检查窗口是否超过最大持续时间将在 t = 0、10、20、30等处进行。
 
 ## 计数窗口
 
@@ -108,7 +84,7 @@ SELECT count(*) FROM demo GROUP BY ID, SESSIONWINDOW(mm, 2, 1);
 SELECT * FROM demo WHERE temperature > 20 GROUP BY COUNTWINDOW(5)
 ```
 
-这个 SQL 按照 5 次对事件进行分组,并且只获取`temperature` 大于 20 的数据。
+这个 SQL 按照 5 次对事件进行分组,并且只获取 `temperature`  大于 20 的数据。
 
 ### 其它计数窗口
 
@@ -117,7 +93,7 @@ SELECT * FROM demo WHERE temperature > 20 GROUP BY COUNTWINDOW(5)
 - 如果第二个参数值为 1, 那么每次事件进来的时候都会被触发
 - 第二个参数的值不应该大于第一个参数的值
 
-以下为`COUNTWINDOW(5,1)` 的示意图,计数窗口长度为 5, 每接收一个事件就触发一次。
+以下为 `COUNTWINDOW(5,1)`  的示意图,计数窗口长度为 5, 每接收一个事件就触发一次。
 
 ![](resources/slidingCountWindow_1.png)
 
@@ -137,12 +113,12 @@ SELECT * FROM demo WHERE temperature > 20 GROUP BY COUNTWINDOW(5,1) HAVING COUNT
 这个 SQL 含有如下条件,
 
 - 有一个计数窗口,长度为 5, 每接收一个事件就触发一次
-- 只获取`temperature` 大于 20 的数据
-- 最后一个条件为消息的条数应该大于 2。如果 `HAVING` 条件为 `COUNT(*)  = 5`, 那么意味着窗口里所有的事件都应该满足 `WHERE` 条件
+- 只获取 `temperature`  大于 20 的数据
+- 最后一个条件为消息的条数应该大于 2。如果 `HAVING`  条件为 `COUNT(*)  = 5`, 那么意味着窗口里所有的事件都应该满足 `WHERE` 条件
 
-## Timestamp Management
+## 时间戳管理
 
-Every event has a timestamp associated with it. The timestamp will be used to calculate the window. By default, a timestamp will be added when an event feed into the source which is called `processing time`. We also support to specify a field as the timestamp, which is called `event time`. The timestamp field is specified in the stream definition. In the below definition, the field `ts` is specified as the timestamp field.
+每个事件都有一个与之关联的时间戳。 时间戳将用于计算窗口。 默认情况下,当事件输入到源时,将添加时间戳,称为`处理时间`。 我们还支持将某个字段指定为时间戳,称为`事件时间`。 时间戳字段在流定义中指定。 在下面的定义中,字段 `ts` 被指定为时间戳字段。
 
 ``
 CREATE STREAM demo (
@@ -152,8 +128,8 @@ CREATE STREAM demo (
 				) WITH (DATASOURCE="demo", FORMAT="json", KEY="ts", TIMESTAMP="ts"
 ``
 
-In event time mode, the watermark algorithm is used to calculate a window.
+在事件时间模式下,水印算法用于计算窗口。
 
-## Runtime error in window
+## 窗口中的运行时错误
 
-If the window receive an error (for example, the data type does not comply to the stream definition) from upstream, the error event will be forwarded immediately to the sink. The current window calculation will ignore the error event
+如果窗口从上游接收到错误(例如,数据类型不符合流定义),则错误事件将立即转发到目标(sink)。 当前窗口计算将忽略错误事件。

+ 16 - 16
docs/zh_CN/streams.md

@@ -3,17 +3,17 @@
 
 ### 数据类型
 
-参考 [Azure IoT](https://docs.microsoft.com/en-us/stream-analytics-query/data-types-azure-stream-analytics), 将布尔类型强制转换为int。
+参考 [Azure IoT](https://docs.microsoft.com/en-us/stream-analytics-query/data-types-azure-stream-analytics), 将布尔类型强制转换为 int。
 
 | #    | 数据类型 | 说明                                                         |
 | ---- | -------- | ------------------------------------------------------------ |
 | 1    | bigint   |                                                              |
 | 2    | float    |                                                              |
 | 3    | string   |                                                              |
-| 4    | datetime | 需要指定日期格式? 例如“ yyyy-MM-dd”                         |
+| 4    | datetime | 需要指定日期格式? 例如 "yyyy-MM-dd"                         |
 | 5    | boolean  |                                                              |
 | 6    | array    | 数组类型可以是简单数据或结构类型中的任何类型(#1-#5和#7)。 |
-| 7    | struct   | The complex type.                                            |
+| 7    | struct   | 复杂类型                                                     |
 
 
 
@@ -32,17 +32,17 @@ CREATE STREAM
 
 | 属性名 | 可选  | 说明                                                |
 | ------------- | -------- | ------------------------------------------------------------ |
-| DATASOURCE | 否   | 如果是MQTT数据源,则列出主题名称。 |
-| FORMAT        | 否   | json 或Avro.<br />目前,我们仅支持JSON类型 ? |
-| KEY           | 是    | 将来将用于GROUP BY语句 ?? |
-| TYPE     | 否   | 如果支持越来越多的源,将来是否需要? 默认情况下,它将是MQTT类型。 |
+| DATASOURCE | 否   | 如果是 MQTT 数据源,则列出主题名称。 |
+| FORMAT        | 否   | json 或 Avro.<br />目前,我们仅支持 JSON 类型 ? |
+| KEY           | 是    | 将来将用于 GROUP BY 语句 ?? |
+| TYPE     | 否   | 如果支持越来越多的源,将来是否需要? 默认情况下,它将是 MQTT 类型。 |
 | StrictValidation     | 否    | 根据流模式控制消息字段的验证行为。 |
 | CONF_KEY | 否 | 如果需要配置其他配置项,请在此处指定配置键。<br />Kuiper当前建议使用yaml文件格式。 |
 
 **StrictValidation介绍**
 
 ``` 
-StrictValidation的值可以为true或false。
+StrictValidation 的值可以为 true  false。
 1)True:如果消息不符合流定义,则删除消息。
 2)False:保留消息,但用默认的空值填充缺少的字段。
 
@@ -80,19 +80,19 @@ CREATE STREAM my_stream
 
 
 
-MQTT源的配置指定以yaml格式,并且配置文件位置在$ kuiper / etc / mqtt_source.yaml处。 以下是文件格式。
+MQTT 源的配置指定以 yaml 格式,并且配置文件位置在`$kuiper/etc/mqtt_source.yaml` 处。 以下是文件格式。
 
 ```yaml
-#Global MQTT configurations
+#全局MQTT配置
 QoS: 1
 Share-subscription: true
 Servers:
   - 
      tcp://127.0.0.1:1883
-#TODO: Other global configurations
+#TODO: 其他全局配置
 
 
-#Override the global configurations
+#重载全局配置
 demo: #Conf_key
   QoS: 0
   Servers:
@@ -148,13 +148,13 @@ my_stream, iot_stream
 
 
 
-### 一个简单的CLI
+### 一个简单的 CLI
 
-一个简单的命令行工具在`stream/cli/main.go`中实现。
+一个简单的命令行工具在 `stream/cli/main.go` 中实现。
 
-#### 运行SQL来管理流
+#### 运行 SQL 来管理流
 
-运行`cli stream`命令,在显示 `kuiper>`提示后,输入与流相关的sql语句,例如create,drop,description,explain和show stream语句以执行操作。
+运行 `cli stream` 命令,在显示 `kuiper>` 提示后,输入与流相关的 sql 语句,例如create,drop,description,explain和show stream语句以执行操作。
 
 ```bash
 cli stream

+ 1 - 1
docs/zh_CN/tutorial.md

@@ -2,7 +2,7 @@
 
 ## 目录结构
 
-以下是安装kuiper之后的安装目录结构。
+以下是安装 kuiper 之后的安装目录结构。
 
 ```
 kuiper_installed_dir