klion26 commented on a change in pull request #12798: URL: https://github.com/apache/flink/pull/12798#discussion_r453438542
########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -180,99 +158,68 @@ FROM Ticker ) MR; {% endhighlight %} -The query partitions the `Ticker` table by the `symbol` column and orders it by the `rowtime` -time attribute. +此查询将 `Ticker` 表按照 `symbol` 列进行分区并按照 `rowtime` 属性进行排序。 -The `PATTERN` clause specifies that we are interested in a pattern with a starting event `START_ROW` -that is followed by one or more `PRICE_DOWN` events and concluded with a `PRICE_UP` event. If such -a pattern can be found, the next pattern match will be seeked at the last `PRICE_UP` event as -indicated by the `AFTER MATCH SKIP TO LAST` clause. +`PATTERN` 子句指定我们对以下模式感兴趣:该模式具有开始事件 `START_ROW`,然后是一个或多个 `PRICE_DOWN` 事件,并以 `PRICE_UP` 事件结束。如果可以找到这样的模式,如 `AFTER MATCH SKIP TO LAST` 子句所示,则从最后一个 `PRICE_UP` 事件开始寻找下一个模式匹配。 -The `DEFINE` clause specifies the conditions that need to be met for a `PRICE_DOWN` and `PRICE_UP` -event. Although the `START_ROW` pattern variable is not present it has an implicit condition that -is evaluated always as `TRUE`. +`DEFINE` 子句指定 `PRICE_DOWN` 和 `PRICE_UP` 事件需要满足的条件。尽管不存在 `START_ROW` 模式变量,但它具有一个始终被评估为 `TRUE` 隐式条件。 -A pattern variable `PRICE_DOWN` is defined as a row with a price that is smaller than the price of -the last row that met the `PRICE_DOWN` condition. For the initial case or when there is no last row -that met the `PRICE_DOWN` condition, the price of the row should be smaller than the price of the -preceding row in the pattern (referenced by `START_ROW`). +模式变量 `PRICE_DOWN` 定义为价格小于满足 `PRICE_DOWN` 条件的最后一行。对于初始情况或没有满足 `PRICE_DOWN` 条件的最后一行时,该行的价格应小于该模式中前一行(由 `START_ROW` 引用)的价格。 -A pattern variable `PRICE_UP` is defined as a row with a price that is larger than the price of the -last row that met the `PRICE_DOWN` condition. +模变变量 `PRICE_UP` 定义为价格大于满足 `PRICE_DOWN` 条件的最后一行。 Review comment: `模变变量` -> `模式变量`? ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -998,29 +898,26 @@ The last result matched against the rows #5, #6. XYZ 17 2018-09-17 10:00:05 2018-09-17 10:00:06 {% endhighlight %} -Again, the first result matched against the rows #1, #2, #3, #4. +同样,第一个结果与#1,#2,#3,#4行匹配。 Review comment: ```suggestion 同样,第一个结果与 #1,#2,#3,#4 行匹配。 ``` ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -976,16 +877,15 @@ The second result matched against the rows #5, #6. XYZ 17 2018-09-17 10:00:05 2018-09-17 10:00:06 {% endhighlight %} -Again, the first result matched against the rows #1, #2, #3, #4. +同样,第一个结果与 #1,#2,#3,#4 行匹配。 -Compared to the previous strategy, the next match includes row #2 again for the next matching. -Therefore, the second result matched against the rows #2, #3, #4, #5. +与上一个策略相比,下一个匹配再次包含 #2 行匹配。因此,第二个结果与 #2,#3,#4,#5 行匹配。 -The third result matched against the rows #3, #4, #5. +第三个结果与#3、#4、#5行匹配。 -The forth result matched against the rows #4, #5, #6. +第四个结果与#4,#5,#6行匹配。 Review comment: ```suggestion 第四个结果与 #4,#5,#6 行匹配。 ``` ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -976,16 +877,15 @@ The second result matched against the rows #5, #6. XYZ 17 2018-09-17 10:00:05 2018-09-17 10:00:06 {% endhighlight %} -Again, the first result matched against the rows #1, #2, #3, #4. +同样,第一个结果与 #1,#2,#3,#4 行匹配。 -Compared to the previous strategy, the next match includes row #2 again for the next matching. -Therefore, the second result matched against the rows #2, #3, #4, #5. +与上一个策略相比,下一个匹配再次包含 #2 行匹配。因此,第二个结果与 #2,#3,#4,#5 行匹配。 -The third result matched against the rows #3, #4, #5. +第三个结果与#3、#4、#5行匹配。 -The forth result matched against the rows #4, #5, #6. +第四个结果与#4,#5,#6行匹配。 -The last result matched against the rows #5, #6. +最后一个结果与第5行、第6行匹配。 Review comment: ```suggestion 最后一个结果与第 5 行、第 6 行匹配。 ``` ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -180,99 +158,68 @@ FROM Ticker ) MR; {% endhighlight %} -The query partitions the `Ticker` table by the `symbol` column and orders it by the `rowtime` -time attribute. +此查询将 `Ticker` 表按照 `symbol` 列进行分区并按照 `rowtime` 属性进行排序。 -The `PATTERN` clause specifies that we are interested in a pattern with a starting event `START_ROW` -that is followed by one or more `PRICE_DOWN` events and concluded with a `PRICE_UP` event. If such -a pattern can be found, the next pattern match will be seeked at the last `PRICE_UP` event as -indicated by the `AFTER MATCH SKIP TO LAST` clause. +`PATTERN` 子句指定我们对以下模式感兴趣:该模式具有开始事件 `START_ROW`,然后是一个或多个 `PRICE_DOWN` 事件,并以 `PRICE_UP` 事件结束。如果可以找到这样的模式,如 `AFTER MATCH SKIP TO LAST` 子句所示,则从最后一个 `PRICE_UP` 事件开始寻找下一个模式匹配。 -The `DEFINE` clause specifies the conditions that need to be met for a `PRICE_DOWN` and `PRICE_UP` -event. Although the `START_ROW` pattern variable is not present it has an implicit condition that -is evaluated always as `TRUE`. +`DEFINE` 子句指定 `PRICE_DOWN` 和 `PRICE_UP` 事件需要满足的条件。尽管不存在 `START_ROW` 模式变量,但它具有一个始终被评估为 `TRUE` 隐式条件。 -A pattern variable `PRICE_DOWN` is defined as a row with a price that is smaller than the price of -the last row that met the `PRICE_DOWN` condition. For the initial case or when there is no last row -that met the `PRICE_DOWN` condition, the price of the row should be smaller than the price of the -preceding row in the pattern (referenced by `START_ROW`). +模式变量 `PRICE_DOWN` 定义为价格小于满足 `PRICE_DOWN` 条件的最后一行。对于初始情况或没有满足 `PRICE_DOWN` 条件的最后一行时,该行的价格应小于该模式中前一行(由 `START_ROW` 引用)的价格。 -A pattern variable `PRICE_UP` is defined as a row with a price that is larger than the price of the -last row that met the `PRICE_DOWN` condition. +模变变量 `PRICE_UP` 定义为价格大于满足 `PRICE_DOWN` 条件的最后一行。 -This query produces a summary row for each period in which the price of a stock was continuously -decreasing. +此查询为股票价格持续下跌的每个期间生成摘要行。 -The exact representation of the output rows is defined in the `MEASURES` part of the query. The -number of output rows is defined by the `ONE ROW PER MATCH` output mode. +在查询的 `MEASURES` 子句部分定义确切的输出行信息。输出行数由 `ONE ROW PER MATCH` 输出方式定义。 {% highlight text %} symbol start_tstamp bottom_tstamp end_tstamp ========= ================== ================== ================== ACME 01-APR-11 10:00:04 01-APR-11 10:00:07 01-APR-11 10:00:08 {% endhighlight %} -The resulting row describes a period of falling prices that started at `01-APR-11 10:00:04` and -achieved the lowest price at `01-APR-11 10:00:07` that increased again at `01-APR-11 10:00:08`. +该行结果描述了从 `01-APR-11 10:00:04` 开始的价格下跌期,在 `01-APR-11 10:00:07` 达到最低价格,到 `01-APR-11 10:00:08` 再次上涨。 -Partitioning +<a name="partitioning"></a> + +分区 ------------ -It is possible to look for patterns in partitioned data, e.g., trends for a single ticker or a -particular user. This can be expressed using the `PARTITION BY` clause. The clause is similar to -using `GROUP BY` for aggregations. +可以在分区数据中寻找模式,例如单个股票行情或特定用户的趋势。这可以用 `PARTITION BY` 子句来表示。该子句类似于对聚合使用 `GROUP BY`。 + +<span class="label label-danger">注意</span> 强烈建议对传入的数据进行分区,否则 `MATCH_RECOGNIZE` 子句将被转换为非并行算子,以确保全局排序。 -<span class="label label-danger">Attention</span> It is highly advised to partition the incoming -data because otherwise the `MATCH_RECOGNIZE` clause will be translated into a non-parallel operator -to ensure global ordering. +<a name="order-of-events"></a> -Order of Events +事件顺序 --------------- -Apache Flink allows for searching for patterns based on time; either -[processing time or event time](time_attributes.html). +Apache Flink 可以根据时间([处理时间或者事件时间]({% link dev/table/streaming/time_attributes.zh.md %}))进行模式搜索。 -In case of event time, the events are sorted before they are passed to the internal pattern state -machine. As a consequence, the produced output will be correct regardless of the order in which -rows are appended to the table. Instead, the pattern is evaluated in the order specified by the -time contained in each row. +如果是事件时间,则在将事件传递到内部模式状态机之前对其进行排序。所以,无论行添加到表的顺序如何,生成的输出都是正确的。相反,模式是按照每行中包含的时间指定的顺序计算的。 -The `MATCH_RECOGNIZE` clause assumes a [time attribute](time_attributes.html) with ascending -ordering as the first argument to `ORDER BY` clause. +`MATCH_RECOGNIZE` 子句假定升序的 [时间属性]({% link dev/table/streaming/time_attributes.zh.md %}) 是 `ORDER BY` 子句的第一个参数。 -For the example `Ticker` table, a definition like `ORDER BY rowtime ASC, price DESC` is valid but -`ORDER BY price, rowtime` or `ORDER BY rowtime DESC, price ASC` is not. +对于示例 `Ticker` 表,诸如 `ORDER BY rowtime ASC, price DESC` 的定义是有效的,但 `ORDER BY price, rowtime` 或者 `ORDER BY rowtime DESC, price ASC` 是无效的。 Define & Measures ----------------- -The `DEFINE` and `MEASURES` keywords have similar meanings to the `WHERE` and `SELECT` clauses in a -simple SQL query. +`DEFINE` 和 `MEASURES` 关键字与简单 SQL 查询中的 `WHERE` 和 `SELECT` 子句具有相近的含义。 -The `MEASURES` clause defines what will be included in the output of a matching pattern. It can -project columns and define expressions for evaluation. The number of produced rows depends on the -[output mode](#output-mode) setting. +`MEASURES` 子句定义匹配模式的输出中要包含哪些内容。它可以投影列并定义表达式进行计算。产生的行数取决于[输出方式](#output-mode)设置。 -The `DEFINE` clause specifies conditions that rows have to fulfill in order to be classified to a -corresponding [pattern variable](#defining-a-pattern). If a condition is not defined for a pattern -variable, a default condition will be used which evaluates to `true` for every row. +`DEFINE` 子句指定行必须满足的条件才能被分类到相应的 [pattern variable](#defining-a-pattern)。如果没有为模式变量定义条件,则将使用对每一行的计算结果为 `true` 的默认条件。 Review comment: 这句话中前面的 `pattern variable` 没有翻译,后面的翻译了,这里建议进行统一,可以统一进行翻译 ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -180,99 +158,68 @@ FROM Ticker ) MR; {% endhighlight %} -The query partitions the `Ticker` table by the `symbol` column and orders it by the `rowtime` -time attribute. +此查询将 `Ticker` 表按照 `symbol` 列进行分区并按照 `rowtime` 属性进行排序。 -The `PATTERN` clause specifies that we are interested in a pattern with a starting event `START_ROW` -that is followed by one or more `PRICE_DOWN` events and concluded with a `PRICE_UP` event. If such -a pattern can be found, the next pattern match will be seeked at the last `PRICE_UP` event as -indicated by the `AFTER MATCH SKIP TO LAST` clause. +`PATTERN` 子句指定我们对以下模式感兴趣:该模式具有开始事件 `START_ROW`,然后是一个或多个 `PRICE_DOWN` 事件,并以 `PRICE_UP` 事件结束。如果可以找到这样的模式,如 `AFTER MATCH SKIP TO LAST` 子句所示,则从最后一个 `PRICE_UP` 事件开始寻找下一个模式匹配。 -The `DEFINE` clause specifies the conditions that need to be met for a `PRICE_DOWN` and `PRICE_UP` -event. Although the `START_ROW` pattern variable is not present it has an implicit condition that -is evaluated always as `TRUE`. +`DEFINE` 子句指定 `PRICE_DOWN` 和 `PRICE_UP` 事件需要满足的条件。尽管不存在 `START_ROW` 模式变量,但它具有一个始终被评估为 `TRUE` 隐式条件。 -A pattern variable `PRICE_DOWN` is defined as a row with a price that is smaller than the price of -the last row that met the `PRICE_DOWN` condition. For the initial case or when there is no last row -that met the `PRICE_DOWN` condition, the price of the row should be smaller than the price of the -preceding row in the pattern (referenced by `START_ROW`). +模式变量 `PRICE_DOWN` 定义为价格小于满足 `PRICE_DOWN` 条件的最后一行。对于初始情况或没有满足 `PRICE_DOWN` 条件的最后一行时,该行的价格应小于该模式中前一行(由 `START_ROW` 引用)的价格。 -A pattern variable `PRICE_UP` is defined as a row with a price that is larger than the price of the -last row that met the `PRICE_DOWN` condition. +模变变量 `PRICE_UP` 定义为价格大于满足 `PRICE_DOWN` 条件的最后一行。 -This query produces a summary row for each period in which the price of a stock was continuously -decreasing. +此查询为股票价格持续下跌的每个期间生成摘要行。 -The exact representation of the output rows is defined in the `MEASURES` part of the query. The -number of output rows is defined by the `ONE ROW PER MATCH` output mode. +在查询的 `MEASURES` 子句部分定义确切的输出行信息。输出行数由 `ONE ROW PER MATCH` 输出方式定义。 {% highlight text %} symbol start_tstamp bottom_tstamp end_tstamp ========= ================== ================== ================== ACME 01-APR-11 10:00:04 01-APR-11 10:00:07 01-APR-11 10:00:08 {% endhighlight %} -The resulting row describes a period of falling prices that started at `01-APR-11 10:00:04` and -achieved the lowest price at `01-APR-11 10:00:07` that increased again at `01-APR-11 10:00:08`. +该行结果描述了从 `01-APR-11 10:00:04` 开始的价格下跌期,在 `01-APR-11 10:00:07` 达到最低价格,到 `01-APR-11 10:00:08` 再次上涨。 -Partitioning +<a name="partitioning"></a> + +分区 ------------ -It is possible to look for patterns in partitioned data, e.g., trends for a single ticker or a -particular user. This can be expressed using the `PARTITION BY` clause. The clause is similar to -using `GROUP BY` for aggregations. +可以在分区数据中寻找模式,例如单个股票行情或特定用户的趋势。这可以用 `PARTITION BY` 子句来表示。该子句类似于对聚合使用 `GROUP BY`。 + +<span class="label label-danger">注意</span> 强烈建议对传入的数据进行分区,否则 `MATCH_RECOGNIZE` 子句将被转换为非并行算子,以确保全局排序。 -<span class="label label-danger">Attention</span> It is highly advised to partition the incoming -data because otherwise the `MATCH_RECOGNIZE` clause will be translated into a non-parallel operator -to ensure global ordering. +<a name="order-of-events"></a> -Order of Events +事件顺序 --------------- -Apache Flink allows for searching for patterns based on time; either -[processing time or event time](time_attributes.html). +Apache Flink 可以根据时间([处理时间或者事件时间]({% link dev/table/streaming/time_attributes.zh.md %}))进行模式搜索。 -In case of event time, the events are sorted before they are passed to the internal pattern state -machine. As a consequence, the produced output will be correct regardless of the order in which -rows are appended to the table. Instead, the pattern is evaluated in the order specified by the -time contained in each row. +如果是事件时间,则在将事件传递到内部模式状态机之前对其进行排序。所以,无论行添加到表的顺序如何,生成的输出都是正确的。相反,模式是按照每行中包含的时间指定的顺序计算的。 -The `MATCH_RECOGNIZE` clause assumes a [time attribute](time_attributes.html) with ascending -ordering as the first argument to `ORDER BY` clause. +`MATCH_RECOGNIZE` 子句假定升序的 [时间属性]({% link dev/table/streaming/time_attributes.zh.md %}) 是 `ORDER BY` 子句的第一个参数。 -For the example `Ticker` table, a definition like `ORDER BY rowtime ASC, price DESC` is valid but -`ORDER BY price, rowtime` or `ORDER BY rowtime DESC, price ASC` is not. +对于示例 `Ticker` 表,诸如 `ORDER BY rowtime ASC, price DESC` 的定义是有效的,但 `ORDER BY price, rowtime` 或者 `ORDER BY rowtime DESC, price ASC` 是无效的。 Define & Measures ----------------- -The `DEFINE` and `MEASURES` keywords have similar meanings to the `WHERE` and `SELECT` clauses in a -simple SQL query. +`DEFINE` 和 `MEASURES` 关键字与简单 SQL 查询中的 `WHERE` 和 `SELECT` 子句具有相近的含义。 -The `MEASURES` clause defines what will be included in the output of a matching pattern. It can -project columns and define expressions for evaluation. The number of produced rows depends on the -[output mode](#output-mode) setting. +`MEASURES` 子句定义匹配模式的输出中要包含哪些内容。它可以投影列并定义表达式进行计算。产生的行数取决于[输出方式](#output-mode)设置。 -The `DEFINE` clause specifies conditions that rows have to fulfill in order to be classified to a -corresponding [pattern variable](#defining-a-pattern). If a condition is not defined for a pattern -variable, a default condition will be used which evaluates to `true` for every row. +`DEFINE` 子句指定行必须满足的条件才能被分类到相应的 [pattern variable](#defining-a-pattern)。如果没有为模式变量定义条件,则将使用对每一行的计算结果为 `true` 的默认条件。 -For a more detailed explanation about expressions that can be used in those clauses, please have a -look at the [event stream navigation](#pattern-navigation) section. +有关在这些子句中可使用的表达式的更详细的说明,请查看 [event stream navigation](#pattern-navigation) 部分。 Review comment: 这里的 `event stream navigation` 和上面也一样 ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -180,99 +158,68 @@ FROM Ticker ) MR; {% endhighlight %} -The query partitions the `Ticker` table by the `symbol` column and orders it by the `rowtime` -time attribute. +此查询将 `Ticker` 表按照 `symbol` 列进行分区并按照 `rowtime` 属性进行排序。 -The `PATTERN` clause specifies that we are interested in a pattern with a starting event `START_ROW` -that is followed by one or more `PRICE_DOWN` events and concluded with a `PRICE_UP` event. If such -a pattern can be found, the next pattern match will be seeked at the last `PRICE_UP` event as -indicated by the `AFTER MATCH SKIP TO LAST` clause. +`PATTERN` 子句指定我们对以下模式感兴趣:该模式具有开始事件 `START_ROW`,然后是一个或多个 `PRICE_DOWN` 事件,并以 `PRICE_UP` 事件结束。如果可以找到这样的模式,如 `AFTER MATCH SKIP TO LAST` 子句所示,则从最后一个 `PRICE_UP` 事件开始寻找下一个模式匹配。 -The `DEFINE` clause specifies the conditions that need to be met for a `PRICE_DOWN` and `PRICE_UP` -event. Although the `START_ROW` pattern variable is not present it has an implicit condition that -is evaluated always as `TRUE`. +`DEFINE` 子句指定 `PRICE_DOWN` 和 `PRICE_UP` 事件需要满足的条件。尽管不存在 `START_ROW` 模式变量,但它具有一个始终被评估为 `TRUE` 隐式条件。 -A pattern variable `PRICE_DOWN` is defined as a row with a price that is smaller than the price of -the last row that met the `PRICE_DOWN` condition. For the initial case or when there is no last row -that met the `PRICE_DOWN` condition, the price of the row should be smaller than the price of the -preceding row in the pattern (referenced by `START_ROW`). +模式变量 `PRICE_DOWN` 定义为价格小于满足 `PRICE_DOWN` 条件的最后一行。对于初始情况或没有满足 `PRICE_DOWN` 条件的最后一行时,该行的价格应小于该模式中前一行(由 `START_ROW` 引用)的价格。 -A pattern variable `PRICE_UP` is defined as a row with a price that is larger than the price of the -last row that met the `PRICE_DOWN` condition. +模变变量 `PRICE_UP` 定义为价格大于满足 `PRICE_DOWN` 条件的最后一行。 -This query produces a summary row for each period in which the price of a stock was continuously -decreasing. +此查询为股票价格持续下跌的每个期间生成摘要行。 -The exact representation of the output rows is defined in the `MEASURES` part of the query. The -number of output rows is defined by the `ONE ROW PER MATCH` output mode. +在查询的 `MEASURES` 子句部分定义确切的输出行信息。输出行数由 `ONE ROW PER MATCH` 输出方式定义。 {% highlight text %} symbol start_tstamp bottom_tstamp end_tstamp ========= ================== ================== ================== ACME 01-APR-11 10:00:04 01-APR-11 10:00:07 01-APR-11 10:00:08 {% endhighlight %} -The resulting row describes a period of falling prices that started at `01-APR-11 10:00:04` and -achieved the lowest price at `01-APR-11 10:00:07` that increased again at `01-APR-11 10:00:08`. +该行结果描述了从 `01-APR-11 10:00:04` 开始的价格下跌期,在 `01-APR-11 10:00:07` 达到最低价格,到 `01-APR-11 10:00:08` 再次上涨。 -Partitioning +<a name="partitioning"></a> + +分区 ------------ -It is possible to look for patterns in partitioned data, e.g., trends for a single ticker or a -particular user. This can be expressed using the `PARTITION BY` clause. The clause is similar to -using `GROUP BY` for aggregations. +可以在分区数据中寻找模式,例如单个股票行情或特定用户的趋势。这可以用 `PARTITION BY` 子句来表示。该子句类似于对聚合使用 `GROUP BY`。 + +<span class="label label-danger">注意</span> 强烈建议对传入的数据进行分区,否则 `MATCH_RECOGNIZE` 子句将被转换为非并行算子,以确保全局排序。 -<span class="label label-danger">Attention</span> It is highly advised to partition the incoming -data because otherwise the `MATCH_RECOGNIZE` clause will be translated into a non-parallel operator -to ensure global ordering. +<a name="order-of-events"></a> -Order of Events +事件顺序 --------------- -Apache Flink allows for searching for patterns based on time; either -[processing time or event time](time_attributes.html). +Apache Flink 可以根据时间([处理时间或者事件时间]({% link dev/table/streaming/time_attributes.zh.md %}))进行模式搜索。 -In case of event time, the events are sorted before they are passed to the internal pattern state -machine. As a consequence, the produced output will be correct regardless of the order in which -rows are appended to the table. Instead, the pattern is evaluated in the order specified by the -time contained in each row. +如果是事件时间,则在将事件传递到内部模式状态机之前对其进行排序。所以,无论行添加到表的顺序如何,生成的输出都是正确的。相反,模式是按照每行中包含的时间指定的顺序计算的。 -The `MATCH_RECOGNIZE` clause assumes a [time attribute](time_attributes.html) with ascending -ordering as the first argument to `ORDER BY` clause. +`MATCH_RECOGNIZE` 子句假定升序的 [时间属性]({% link dev/table/streaming/time_attributes.zh.md %}) 是 `ORDER BY` 子句的第一个参数。 -For the example `Ticker` table, a definition like `ORDER BY rowtime ASC, price DESC` is valid but -`ORDER BY price, rowtime` or `ORDER BY rowtime DESC, price ASC` is not. +对于示例 `Ticker` 表,诸如 `ORDER BY rowtime ASC, price DESC` 的定义是有效的,但 `ORDER BY price, rowtime` 或者 `ORDER BY rowtime DESC, price ASC` 是无效的。 Define & Measures ----------------- -The `DEFINE` and `MEASURES` keywords have similar meanings to the `WHERE` and `SELECT` clauses in a -simple SQL query. +`DEFINE` 和 `MEASURES` 关键字与简单 SQL 查询中的 `WHERE` 和 `SELECT` 子句具有相近的含义。 -The `MEASURES` clause defines what will be included in the output of a matching pattern. It can -project columns and define expressions for evaluation. The number of produced rows depends on the -[output mode](#output-mode) setting. +`MEASURES` 子句定义匹配模式的输出中要包含哪些内容。它可以投影列并定义表达式进行计算。产生的行数取决于[输出方式](#output-mode)设置。 -The `DEFINE` clause specifies conditions that rows have to fulfill in order to be classified to a -corresponding [pattern variable](#defining-a-pattern). If a condition is not defined for a pattern -variable, a default condition will be used which evaluates to `true` for every row. +`DEFINE` 子句指定行必须满足的条件才能被分类到相应的 [pattern variable](#defining-a-pattern)。如果没有为模式变量定义条件,则将使用对每一行的计算结果为 `true` 的默认条件。 -For a more detailed explanation about expressions that can be used in those clauses, please have a -look at the [event stream navigation](#pattern-navigation) section. +有关在这些子句中可使用的表达式的更详细的说明,请查看 [event stream navigation](#pattern-navigation) 部分。 ### Aggregations -Aggregations can be used in `DEFINE` and `MEASURES` clauses. Both -[built-in]({{ site.baseurl }}/dev/table/functions/systemFunctions.html) and custom -[user defined]({{ site.baseurl }}/dev/table/functions/udfs.html) functions are supported. +Aggregations 可以在 `DEFINE` 和 `MEASURES` 子句中使用。支持[内置函数]({% link dev/table/functions/systemFunctions.zh.md %})和[用户自定义函数]({% link dev/table/functions/udfs.zh.md %})。 -Aggregate functions are applied to each subset of rows mapped to a match. In order to understand -how those subsets are evaluated have a look at the [event stream navigation](#pattern-navigation) -section. +对相应匹配项的行子集可以使用 Aggregate functions。请查看 [event stream navigation](#pattern-navigation) 部分以了解如何计算这些子集。 Review comment: 这里的 `event stream navigation` 建议翻译,下面的标题已经翻译了 ########## File path: docs/dev/table/streaming/match_recognize.zh.md ########## @@ -976,16 +877,15 @@ The second result matched against the rows #5, #6. XYZ 17 2018-09-17 10:00:05 2018-09-17 10:00:06 {% endhighlight %} -Again, the first result matched against the rows #1, #2, #3, #4. +同样,第一个结果与 #1,#2,#3,#4 行匹配。 -Compared to the previous strategy, the next match includes row #2 again for the next matching. -Therefore, the second result matched against the rows #2, #3, #4, #5. +与上一个策略相比,下一个匹配再次包含 #2 行匹配。因此,第二个结果与 #2,#3,#4,#5 行匹配。 -The third result matched against the rows #3, #4, #5. +第三个结果与#3、#4、#5行匹配。 Review comment: ```suggestion 第三个结果与 #3、#4、#5 行匹配。 ``` ---------------------------------------------------------------- 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: us...@infra.apache.org