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/05/09 03:48:17 UTC

[GitHub] [flink] klion26 commented on a change in pull request #11978: [FLINK-16086][chinese-translation]Translate "Temporal Tables" page of "Streaming Concepts" into Chinese

klion26 commented on a change in pull request #11978:
URL: https://github.com/apache/flink/pull/11978#discussion_r422446310



##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -22,23 +22,23 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+时态表(Temporal Table)表示一直在变化的表上一个(参数化)视图的概念,该视图返回表在某个特定时间点的内容。
 
-The changing table can either be a changing history table which tracks the changes (e.g. database changelogs) or a changing dimension table which materializes the changes (e.g. database tables).
+变化的表可以是追踪变化的变化历史记录表(例如:数据库变更日志),也可以是有具体更改的维表(例如:数据库表)。

Review comment:
       “变化的表可以是追踪变化的变化历史记录表(例如:数据库变更日志)” -> “变更表可以是跟踪变化的历史记录表(如数据库变化记录)。” 会更好一点吗?

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -1,5 +1,5 @@
 ---
-title: "Temporal Tables"
+title: "时态表(Temporal Tables)"

Review comment:
       “时态表” 这个偏专有名词,需要其他人确认下是否合理。

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -22,23 +22,23 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+时态表(Temporal Table)表示一直在变化的表上一个(参数化)视图的概念,该视图返回表在某个特定时间点的内容。
 
-The changing table can either be a changing history table which tracks the changes (e.g. database changelogs) or a changing dimension table which materializes the changes (e.g. database tables).
+变化的表可以是追踪变化的变化历史记录表(例如:数据库变更日志),也可以是有具体更改的维表(例如:数据库表)。
 
-For the changing history table, Flink can keep track of the changes and allows for accessing the content of the table at a certain point in time within a query. In Flink, this kind of table is represented by a *Temporal Table Function*.
+对于表的历史变化,Flink 可以追踪这些变化,并且允许查询这张表在某个特定时间点的内容。在 Flink 中,这类表由 *时态表函数(Temporal Table Function)* 表示。

Review comment:
       这里的 “changing history table”指上面两种的一种吧,表示“changelog”。这里是否有比 “对于表的历史变化”更好的翻译呢?

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -53,10 +53,9 @@ rowtime currency   rate
 11:49   Pounds      108
 {% endhighlight %}
 
-`RatesHistory` represents an ever growing append-only table of currency exchange rates with respect to `Yen` (which has a rate of `1`).
-For example, the exchange rate for the period from `09:00` to `10:45` of `Euro` to `Yen` was `114`. From `10:45` to `11:15` it was `116`.
+`RatesHistory` 表示一个关于日元且不断增长的货币汇率 append-only 表(汇率为1)。例如,`欧元`兑`日元`从 `09:00` 到 `10:45` 的汇率为 `114`。从 `10:45` 到 `11:15` ,汇率为 `116`。
 
-Given that we would like to output all current rates at the time `10:58`, we would need the following SQL query to compute a result table:
+假设我们要输出在 `10:58` 的时间的所有当前汇率,则需要以下 SQL 查询来计算结果表:

Review comment:
       “假设我们要输出在 `10:58` 的时间的所有当前汇率" -> "假设我们要输出 `10:58` 的所有当前汇率”是否会更好一些呢

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -22,23 +22,23 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+时态表(Temporal Table)表示一直在变化的表上一个(参数化)视图的概念,该视图返回表在某个特定时间点的内容。
 
-The changing table can either be a changing history table which tracks the changes (e.g. database changelogs) or a changing dimension table which materializes the changes (e.g. database tables).
+变化的表可以是追踪变化的变化历史记录表(例如:数据库变更日志),也可以是有具体更改的维表(例如:数据库表)。
 
-For the changing history table, Flink can keep track of the changes and allows for accessing the content of the table at a certain point in time within a query. In Flink, this kind of table is represented by a *Temporal Table Function*.
+对于表的历史变化,Flink 可以追踪这些变化,并且允许查询这张表在某个特定时间点的内容。在 Flink 中,这类表由 *时态表函数(Temporal Table Function)* 表示。
 
-For the changing dimension table, Flink allows for accessing the content of the table at processing time within a query. In Flink, this kind of table is represented by a *Temporal Table*.
+对于变化的维表,Flink 允许查询这张表在处理时的内容,在 Flink 中,此类表由 *时态表(Temporal Table)* 表示。
 
 * This will be replaced by the TOC
 {:toc}
 
-Motivation
+设计初衷
 ----------
 
-### Correlate with a changing history table
+### 与表的历史变化相关

Review comment:
       “changing history table” 有一个更好的翻译吗?现在的翻译不能体现“changelog”

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -68,9 +67,9 @@ WHERE r.rowtime = (
   AND r2.rowtime <= TIME '10:58');
 {% endhighlight %}
 
-The correlated subquery determines the maximum time for the corresponding currency that is lower or equal than the desired time. The outer query lists the rates that have a maximum timestamp.
-
-The following table shows the result of such a computation. In our example, the update to `Euro` at `10:45` is taken into account, however, the update to `Euro` at `11:15` and the new entry of `Pounds` are not considered in the table's version at time `10:58`.
+子查询确定对应货币的最大时间小于或等于所需时间。外部查询列出具有最大时间戳的汇率。 
+ 
+下表显示了这种计算的结果。在我们的示例中,考虑了 `10:45` 时`欧元`的更新,但是在 `10:58` 时,该表的版本中未考虑对 `11:15` 处的`欧元`更新和`英镑`的新值。

Review comment:
       “在我们的示例中,考虑了 `10:45` 时`欧元`的更新,但是在 `10:58` 时,该表的版本中未考虑对 `11:15` 处的`欧元`更新和`英镑`的新值。” -> “在我们的示例中,`10:58` 的表版本,考虑了 `10:45` 的更新,但未考虑 `11:15` 的更新” 是否会更好呢?(或者有其他更好的翻译也更好)

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -80,17 +79,17 @@ rowtime currency   rate
 10:45   Euro        116
 {% endhighlight %}
 
-The concept of *Temporal Tables* aims to simplify such queries, speed up their execution, and reduce Flink's state usage. A *Temporal Table* is a parameterized view on an append-only table that interprets the rows of the append-only table as the changelog of a table and provides the version of that table at a specific point in time. Interpreting the append-only table as a changelog requires the specification of a primary key attribute and a timestamp attribute. The primary key determines which rows are overwritten and the timestamp determines the time during which a row is valid.
+ *时态表* 的概念旨在简化此类查询,加快其执行速度,并减少 Flink 的状态使用率。*时态表* 是 append-only 表上的参数化视图,该视图将 append-only 表的行解释为表的变更日志,并在特定时间点提供该表的版本。将 append-only 表解释为变更日志需要指定主键属性和时间戳属性。主键确定哪些行将被覆盖,时间戳确定行有效的时间。
 
-In the above example `currency` would be a primary key for `RatesHistory` table and `rowtime` would be the timestamp attribute.
+在上面的示例中,`currency` 是 `RatesHistory` 表的主键,而 `rowtime` 是时间戳属性。
 
-In Flink, this is represented by a [*Temporal Table Function*](#temporal-table-function).
+在Flink中, 这由 [*时态表函数*](#temporal-table-function) 表示.
 
-### Correlate with a changing dimension table
+### 与维表变化相关
 
-On the other hand, some use cases require to join a changing dimension table which is an external database table.
+另一方面,某些用例需要连接变化的维表,该表是外部数据库表。
 
-Let's assume that `LatestRates` is a table (e.g. stored in) which is materialized with the latest rate. The `LatestRates` is the materialized history `RatesHistory`. Then the content of `LatestRates` table at time `10:58` will be:
+假设 `LatestRates` 是一个以最新汇率实现的表(例如,存储在其中)。`LatestRates` 是物化的 `RatesHistory` 历史。然后在时间 `10:58` 的 `LatestRates`表的内容将是:

Review comment:
       “假设 `LatestRates` 是一个以最新汇率实现的表(例如,存储在其中)” -> “假设 `LatestRates` 是一个表示最新汇率的表(例如,存储在其中)”
   “然后在时间 `10:58` 的 `LatestRates`表的内容将是:” -> “那么`LatestRates` 表在 `10:58` 的内容将是:”
   
   是不是会更好一些呢?

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -80,17 +79,17 @@ rowtime currency   rate
 10:45   Euro        116
 {% endhighlight %}
 
-The concept of *Temporal Tables* aims to simplify such queries, speed up their execution, and reduce Flink's state usage. A *Temporal Table* is a parameterized view on an append-only table that interprets the rows of the append-only table as the changelog of a table and provides the version of that table at a specific point in time. Interpreting the append-only table as a changelog requires the specification of a primary key attribute and a timestamp attribute. The primary key determines which rows are overwritten and the timestamp determines the time during which a row is valid.
+ *时态表* 的概念旨在简化此类查询,加快其执行速度,并减少 Flink 的状态使用率。*时态表* 是 append-only 表上的参数化视图,该视图将 append-only 表的行解释为表的变更日志,并在特定时间点提供该表的版本。将 append-only 表解释为变更日志需要指定主键属性和时间戳属性。主键确定哪些行将被覆盖,时间戳确定行有效的时间。

Review comment:
       ```suggestion
    *时态表* 的概念旨在简化此类查询,加快其执行速度,并减少 Flink 的状态使用。*时态表* 是 append-only 表上的参数化视图,该视图将 append-only 表的行解释为表的变更日志,并在特定时间点提供该表的版本。将 append-only 表解释为变更日志需要指定主键属性和时间戳属性。主键确定哪些行将被覆盖,时间戳确定行有效的时间。
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -113,18 +112,20 @@ Euro        119
 Pounds      108
 {% endhighlight %}
 
-In Flink, this is represented by a [*Temporal Table*](#temporal-table).
+在Flink中,这由 [*时态表*](#temporal-table)表示.
+
+<a name="temporal-table-function"></a>
 
-Temporal Table Function
+时态表函数
 ------------------------
 
-In order to access the data in a temporal table, one must pass a [time attribute](time_attributes.html) that determines the version of the table that will be returned.
-Flink uses the SQL syntax of [table functions]({{ site.baseurl }}/dev/table/functions/udfs.html#table-functions) to provide a way to express it.
+为了访问时态表中的数据,必须传递一个[时间属性](time_attributes.html),该属性确定将要返回的表的版本。
+ Flink 使用[表函数]({{ site.baseurl }}/zh/dev/table/functions/udfs.html#table-functions) 的SQL语法提供一种表达它的方法。

Review comment:
       ```suggestion
    Flink 使用[表函数]({{ site.baseurl }}/zh/dev/table/functions/udfs.html#table-functions) 的 SQL 语法提供一种表达它的方法。
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -144,16 +145,15 @@ rowtime currency   rate
 09:00   Yen           1
 {% endhighlight %}
 
-Each query to `Rates(timeAttribute)` would return the state of the `Rates` for the given `timeAttribute`.
+对 `Rates(timeAttribute)` 的每个查询都将返回给定 `timeAttribute` 的 `Rates` 状态。
 
-**Note**: Currently, Flink doesn't support directly querying the temporal table functions with a constant time attribute parameter. At the moment, temporal table functions can only be used in joins.
-The example above was used to provide an intuition about what the function `Rates(timeAttribute)` returns.
+**注意**: 当前 Flink 不支持使用常量时间属性参数直接查询时态表函数。目前,时态表函数只能在 join 中使用。上面的示例用于提供有关函数 `Rates(timeAttribute)` 返回内容的直观信息。
 
-See also the page about [joins for continuous queries](joins.html) for more information about how to join with a temporal table.
+另请参阅有关[用于持续查询的 join ](joins.html)的页面,以获取有关如何与时态表 join 的更多信息。

Review comment:
       ```suggestion
   另请参阅有关[用于持续查询的 join ](joins.html)页面,以获取有关如何与时态表 join 的更多信息。
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -144,16 +145,15 @@ rowtime currency   rate
 09:00   Yen           1
 {% endhighlight %}
 
-Each query to `Rates(timeAttribute)` would return the state of the `Rates` for the given `timeAttribute`.
+对 `Rates(timeAttribute)` 的每个查询都将返回给定 `timeAttribute` 的 `Rates` 状态。
 
-**Note**: Currently, Flink doesn't support directly querying the temporal table functions with a constant time attribute parameter. At the moment, temporal table functions can only be used in joins.
-The example above was used to provide an intuition about what the function `Rates(timeAttribute)` returns.
+**注意**: 当前 Flink 不支持使用常量时间属性参数直接查询时态表函数。目前,时态表函数只能在 join 中使用。上面的示例用于提供有关函数 `Rates(timeAttribute)` 返回内容的直观信息。

Review comment:
       ```suggestion
   **注意**:当前 Flink 不支持使用常量时间属性参数直接查询时态表函数。目前,时态表函数只能在 join 中使用。上面的示例用于提供有关函数 `Rates(timeAttribute)` 返回内容的直观信息。
   ```
   
   “上面的示例用于提供有关函数 `Rates(timeAttribute)` 返回内容的直观信息。” 有一个更好的翻译吗?个人感觉意思没啥问题,读起来优点不太通顺
   

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -216,19 +216,20 @@ tEnv.registerFunction("Rates", rates)                                          /
 </div>
 </div>
 
-Line `(1)` creates a `rates` [temporal table function](#temporal-table-functions),
-which allows us to use the function `rates` in the [Table API](../tableApi.html#joins).
+行 `(1)` 创建了一个 `rates` [时态表函数](#temporal-table-function),
+这使我们可以在[ Table API ](../tableApi.html#joins)中使用 `rates` 函数。
+
+行 `(2)` 在表环境中注册名称为 `Rates` 的函数,这使我们可以在[ SQL ]({{ site.baseurl }}/zh/dev/table/sql/queries.html#joins)中使用 `Rates` 函数。
 
-Line `(2)` registers this function under the name `Rates` in our table environment,
-which allows us to use the `Rates` function in [SQL]({{ site.baseurl }}/dev/table/sql/queries.html#joins).
+<a name="temporal-table"></a>
 
-## Temporal Table
+## 时态表
 
-<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">注意</span> 仅 Blink planner 支持此功能。
 
-In order to access data in temporal table, currently one must define a `TableSource` with `LookupableTableSource`. Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011.
+为了访问时态表中的数据,当前必须使用 `LookupableTableSource` 定义一个 `TableSource` 。Flink使用 `FOR SYSTEM_TIME AS OF` 的SQL语法查询时态表,它在SQL:2011中被提出。

Review comment:
       ```suggestion
   为了访问时态表中的数据,当前必须使用 `LookupableTableSource` 定义一个 `TableSource` 。Flink 使用 SQL:2011 中提出的 `FOR SYSTEM_TIME AS OF` 的 SQL 语法查询时态表。
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -248,11 +249,11 @@ Euro        116
 Yen           1
 {% endhighlight %}
 
-**Note**: Currently, Flink doesn't support directly querying the temporal table with a constant time. At the moment, temporal table can only be used in joins. The example above is used to provide an intuition about what the temporal table `LatestRates` returns.
+**注意**: 当前,Flink 不支持以固定时间直接查询时态表。目前,时态表只能在 join 中使用。上面的示例用于提供有关时态表 `LatestRates` 返回内容的直观信息。

Review comment:
       ```suggestion
   **注意**:当前,Flink 不支持以固定时间直接查询时态表。目前,时态表只能在 join 中使用。上面的示例用于提供有关时态表 `LatestRates` 返回内容的直观信息。
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.zh.md
##########
@@ -113,18 +112,20 @@ Euro        119
 Pounds      108
 {% endhighlight %}
 
-In Flink, this is represented by a [*Temporal Table*](#temporal-table).
+在Flink中,这由 [*时态表*](#temporal-table)表示.

Review comment:
       ```suggestion
   在Flink中,这由[*时态表*](#temporal-table)表示.
   ```




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