You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/07/02 11:05:21 UTC

[GitHub] [flink] XBaith commented on a change in pull request #12798: [FLINK-16087][docs-zh] Translate "Detecting Patterns" page of "Streaming Concepts" into Chinese

XBaith commented on a change in pull request #12798:
URL: https://github.com/apache/flink/pull/12798#discussion_r448876995



##########
File path: docs/dev/table/streaming/match_recognize.zh.md
##########
@@ -24,28 +24,17 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-It is a common use case to search for a set of event patterns, especially in case of data streams.
-Flink comes with a [complex event processing (CEP) library]({{ site.baseurl }}/dev/libs/cep.html)
-which allows for pattern detection in event streams. Furthermore, Flink's SQL API provides a
-relational way of expressing queries with a large set of built-in functions and rule-based
-optimizations that can be used out of the box.
-
-In December 2016, the International Organization for Standardization (ISO) released a new version
-of the SQL standard which includes _Row Pattern Recognition in SQL_
-([ISO/IEC TR 19075-5:2016](https://standards.iso.org/ittf/PubliclyAvailableStandards/c065143_ISO_IEC_TR_19075-5_2016.zip)).
-It allows Flink to consolidate CEP and SQL API using the `MATCH_RECOGNIZE` clause for complex event
-processing in SQL.
-
-A `MATCH_RECOGNIZE` clause enables the following tasks:
-* Logically partition and order the data that is used with the `PARTITION BY` and `ORDER BY`
-  clauses.
-* Define patterns of rows to seek using the `PATTERN` clause. These patterns use a syntax similar to
-  that of regular expressions.
-* The logical components of the row pattern variables are specified in the `DEFINE` clause.
-* Define measures, which are expressions usable in other parts of the SQL query, in the `MEASURES`
-  clause.
-
-The following example illustrates the syntax for basic pattern recognition:
+搜索一组事件模式(event pattern)是一种常见的用例,尤其是在数据流的情况下。Flink 提供 [复杂事件处理(CEP)库]({% link dev/libs/cep.zh.md %}),该库允许在事件流中进行模式检测。此外,Flink 的 SQL API 提供了一种关系式的查询表达方式,其中包含一大组内置函数和基于规则的优化,可以开箱即用。
+
+2016年12月,国际标准化组织(ISO)发布了新版本的 SQL 标准,其中包括在 _SQL 中的行模式识别(Row Pattern Recognition in SQL)_([ISO/IEC TR 19075-5:2016](https://standards.iso.org/ittf/PubliclyAvailableStandards/c065143_ISO_IEC_TR_19075-5_2016.zip))。它允许 Flink 使用 `MATCH_RECOGNIZE` 子句融合 CEP 和 SQL API,以便在 SQL 中进行复杂事件处理。
+
+一个 `MATCH_RECOGNIZE` 子句启用以下任务:

Review comment:
       ```suggestion
   `MATCH_RECOGNIZE` 子句启用以下任务:
   ```

##########
File path: docs/dev/table/streaming/match_recognize.zh.md
##########
@@ -24,28 +24,17 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-It is a common use case to search for a set of event patterns, especially in case of data streams.
-Flink comes with a [complex event processing (CEP) library]({{ site.baseurl }}/dev/libs/cep.html)
-which allows for pattern detection in event streams. Furthermore, Flink's SQL API provides a
-relational way of expressing queries with a large set of built-in functions and rule-based
-optimizations that can be used out of the box.
-
-In December 2016, the International Organization for Standardization (ISO) released a new version
-of the SQL standard which includes _Row Pattern Recognition in SQL_
-([ISO/IEC TR 19075-5:2016](https://standards.iso.org/ittf/PubliclyAvailableStandards/c065143_ISO_IEC_TR_19075-5_2016.zip)).
-It allows Flink to consolidate CEP and SQL API using the `MATCH_RECOGNIZE` clause for complex event
-processing in SQL.
-
-A `MATCH_RECOGNIZE` clause enables the following tasks:
-* Logically partition and order the data that is used with the `PARTITION BY` and `ORDER BY`
-  clauses.
-* Define patterns of rows to seek using the `PATTERN` clause. These patterns use a syntax similar to
-  that of regular expressions.
-* The logical components of the row pattern variables are specified in the `DEFINE` clause.
-* Define measures, which are expressions usable in other parts of the SQL query, in the `MEASURES`
-  clause.
-
-The following example illustrates the syntax for basic pattern recognition:
+搜索一组事件模式(event pattern)是一种常见的用例,尤其是在数据流的情况下。Flink 提供 [复杂事件处理(CEP)库]({% link dev/libs/cep.zh.md %}),该库允许在事件流中进行模式检测。此外,Flink 的 SQL API 提供了一种关系式的查询表达方式,其中包含一大组内置函数和基于规则的优化,可以开箱即用。
+
+2016年12月,国际标准化组织(ISO)发布了新版本的 SQL 标准,其中包括在 _SQL 中的行模式识别(Row Pattern Recognition in SQL)_([ISO/IEC TR 19075-5:2016](https://standards.iso.org/ittf/PubliclyAvailableStandards/c065143_ISO_IEC_TR_19075-5_2016.zip))。它允许 Flink 使用 `MATCH_RECOGNIZE` 子句融合 CEP 和 SQL API,以便在 SQL 中进行复杂事件处理。
+
+一个 `MATCH_RECOGNIZE` 子句启用以下任务:
+* 对与 `PARTITION BY` 和 `ORDER BY` 子句一起使用的数据进行逻辑分区和排序。
+* 使用 `PATTERN` 子句定义要查找的行的模式。这些模式使用类似于正则表达式的语法。
+* 行模式变量的逻辑组件在 `DEFINE` 子句中指定。
+* 在 `MEASURES` 子句中定义可用于 SQL 查询其他部分的表达式 measures。

Review comment:
       该句翻译是我的个人理解,可能并不完全正确。
   ```suggestion
   * measures 是指在 `MEASURES` 子句中定义的表达式,这些表达式可用在 SQL 查询中的其他部分。
   ```

##########
File path: docs/dev/table/streaming/match_recognize.zh.md
##########
@@ -92,52 +76,39 @@ project.
 </dependency>
 {% endhighlight %}
 
-Alternatively, you can also add the dependency to the cluster classpath (see the
-[dependency section]({{ site.baseurl}}/dev/project-configuration.html) for more information).
+或者,也可以将依赖项添加到集群类路径(查看[依赖部分]({% link dev/project-configuration.zh.md %})获取更多信息)。
 
-If you want to use the `MATCH_RECOGNIZE` clause in the
-[SQL Client]({{ site.baseurl}}/dev/table/sqlClient.html), you don't have to do anything as all the
-dependencies are included by default.
+如果你想在 [SQL Client]({% link dev/table/sqlClient.zh.md %}) 中使用 `MATCH_RECOGNIZE` 子句,你无需执行任何操作,因为默认情况下包含所有依赖项。
 
-### SQL Semantics
+### SQL 语义
 
-Every `MATCH_RECOGNIZE` query consists of the following clauses:
+每个 `MATCH_RECOGNIZE` 查询都包含以下子句:
 
-* [PARTITION BY](#partitioning) - defines the logical partitioning of the table; similar to a
-  `GROUP BY` operation.
-* [ORDER BY](#order-of-events) - specifies how the incoming rows should be ordered; this is
-  essential as patterns depend on an order.
-* [MEASURES](#define--measures) - defines output of the clause; similar to a `SELECT` clause.
-* [ONE ROW PER MATCH](#output-mode) - output mode which defines how many rows per match should be
-  produced.
-* [AFTER MATCH SKIP](#after-match-strategy) - specifies where the next match should start; this is
-  also a way to control how many distinct matches a single event can belong to.
-* [PATTERN](#defining-a-pattern) - allows constructing patterns that will be searched for using a
-  _regular expression_-like syntax.
-* [DEFINE](#define--measures) - this section defines the conditions that the pattern variables must
-  satisfy.
+* [PARTITION BY](#分区) - 定义表的逻辑分区;类似于 `GROUP BY` 操作。
+* [ORDER BY](#事件顺序) - 指定传入行的排序方式;这是必须的,因为模式依赖于顺序。
+* [MEASURES](#define--measures) - 定义子句的输出;类似于 `SELECT` 子句。
+* [ONE ROW PER MATCH](#输出方式) - 定义每次匹配应生成多少行的输出方式。

Review comment:
       ```suggestion
   * [ONE ROW PER MATCH](#输出方式) - 输出方式,定义每个匹配项应产生多少行。
   ```

##########
File path: docs/dev/table/streaming/match_recognize.zh.md
##########
@@ -92,52 +76,39 @@ project.
 </dependency>
 {% endhighlight %}
 
-Alternatively, you can also add the dependency to the cluster classpath (see the
-[dependency section]({{ site.baseurl}}/dev/project-configuration.html) for more information).
+或者,也可以将依赖项添加到集群类路径(查看[依赖部分]({% link dev/project-configuration.zh.md %})获取更多信息)。
 
-If you want to use the `MATCH_RECOGNIZE` clause in the
-[SQL Client]({{ site.baseurl}}/dev/table/sqlClient.html), you don't have to do anything as all the
-dependencies are included by default.
+如果你想在 [SQL Client]({% link dev/table/sqlClient.zh.md %}) 中使用 `MATCH_RECOGNIZE` 子句,你无需执行任何操作,因为默认情况下包含所有依赖项。
 
-### SQL Semantics
+### SQL 语义
 
-Every `MATCH_RECOGNIZE` query consists of the following clauses:
+每个 `MATCH_RECOGNIZE` 查询都包含以下子句:
 
-* [PARTITION BY](#partitioning) - defines the logical partitioning of the table; similar to a
-  `GROUP BY` operation.
-* [ORDER BY](#order-of-events) - specifies how the incoming rows should be ordered; this is
-  essential as patterns depend on an order.
-* [MEASURES](#define--measures) - defines output of the clause; similar to a `SELECT` clause.
-* [ONE ROW PER MATCH](#output-mode) - output mode which defines how many rows per match should be
-  produced.
-* [AFTER MATCH SKIP](#after-match-strategy) - specifies where the next match should start; this is
-  also a way to control how many distinct matches a single event can belong to.
-* [PATTERN](#defining-a-pattern) - allows constructing patterns that will be searched for using a
-  _regular expression_-like syntax.
-* [DEFINE](#define--measures) - this section defines the conditions that the pattern variables must
-  satisfy.
+* [PARTITION BY](#分区) - 定义表的逻辑分区;类似于 `GROUP BY` 操作。
+* [ORDER BY](#事件顺序) - 指定传入行的排序方式;这是必须的,因为模式依赖于顺序。
+* [MEASURES](#define--measures) - 定义子句的输出;类似于 `SELECT` 子句。
+* [ONE ROW PER MATCH](#输出方式) - 定义每次匹配应生成多少行的输出方式。
+* [AFTER MATCH SKIP](#匹配后的策略) - 指定下一个匹配的开始位置;这也是一种控制单个事件可以属于多少个不同匹配的方法。
+* [PATTERN](#定义模式) - 允许使用类似于 _正则表达式_ 的语法构造将要搜索的模式。

Review comment:
       ```suggestion
   * [PATTERN](#定义模式) - 允许构造类似于 _正则表达式_ 语法进行搜索的模式。
   ```

##########
File path: docs/dev/table/streaming/match_recognize.zh.md
##########
@@ -92,52 +76,39 @@ project.
 </dependency>
 {% endhighlight %}
 
-Alternatively, you can also add the dependency to the cluster classpath (see the
-[dependency section]({{ site.baseurl}}/dev/project-configuration.html) for more information).
+或者,也可以将依赖项添加到集群类路径(查看[依赖部分]({% link dev/project-configuration.zh.md %})获取更多信息)。
 
-If you want to use the `MATCH_RECOGNIZE` clause in the
-[SQL Client]({{ site.baseurl}}/dev/table/sqlClient.html), you don't have to do anything as all the
-dependencies are included by default.
+如果你想在 [SQL Client]({% link dev/table/sqlClient.zh.md %}) 中使用 `MATCH_RECOGNIZE` 子句,你无需执行任何操作,因为默认情况下包含所有依赖项。
 
-### SQL Semantics
+### SQL 语义
 
-Every `MATCH_RECOGNIZE` query consists of the following clauses:
+每个 `MATCH_RECOGNIZE` 查询都包含以下子句:
 
-* [PARTITION BY](#partitioning) - defines the logical partitioning of the table; similar to a
-  `GROUP BY` operation.
-* [ORDER BY](#order-of-events) - specifies how the incoming rows should be ordered; this is
-  essential as patterns depend on an order.
-* [MEASURES](#define--measures) - defines output of the clause; similar to a `SELECT` clause.
-* [ONE ROW PER MATCH](#output-mode) - output mode which defines how many rows per match should be
-  produced.
-* [AFTER MATCH SKIP](#after-match-strategy) - specifies where the next match should start; this is
-  also a way to control how many distinct matches a single event can belong to.
-* [PATTERN](#defining-a-pattern) - allows constructing patterns that will be searched for using a
-  _regular expression_-like syntax.
-* [DEFINE](#define--measures) - this section defines the conditions that the pattern variables must
-  satisfy.
+* [PARTITION BY](#分区) - 定义表的逻辑分区;类似于 `GROUP BY` 操作。
+* [ORDER BY](#事件顺序) - 指定传入行的排序方式;这是必须的,因为模式依赖于顺序。
+* [MEASURES](#define--measures) - 定义子句的输出;类似于 `SELECT` 子句。
+* [ONE ROW PER MATCH](#输出方式) - 定义每次匹配应生成多少行的输出方式。
+* [AFTER MATCH SKIP](#匹配后的策略) - 指定下一个匹配的开始位置;这也是一种控制单个事件可以属于多少个不同匹配的方法。
+* [PATTERN](#定义模式) - 允许使用类似于 _正则表达式_ 的语法构造将要搜索的模式。
+* [DEFINE](#define--measures) - 本节定义模式变量必须满足的条件。

Review comment:
       ```suggestion
   * [DEFINE](#define--measures) - 该部分定义了变量必须满足的条件。
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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