libenchao commented on a change in pull request #10822:
[FLINK-15081][docs-zh]Translate "Concepts & Common API" page of Table…
URL: https://github.com/apache/flink/pull/10822#discussion_r382671421
##########
File path: docs/dev/table/common.zh.md
##########
@@ -1091,17 +1070,17 @@ val dsTuple: DataSet[(String, Int)] =
tableEnv.toDataSet[(String, Int)](table)
{% top %}
-### Mapping of Data Types to Table Schema
+### 数据类型到 Table Schema 的映射
-Flink's DataStream and DataSet APIs support very diverse types. Composite
types such as Tuples (built-in Scala and Flink Java tuples), POJOs, Scala case
classes, and Flink's Row type allow for nested data structures with multiple
fields that can be accessed in table expressions. Other types are treated as
atomic types. In the following, we describe how the Table API converts these
types into an internal row representation and show examples of converting a
`DataStream` into a `Table`.
+Flink 的 DataStream 和 DataSet APIs 支持多样的数据类型。例如 Tuple(Scala 内置以及Flink Java
tuple)、POJO 类型、Scala case class 类型以及 Flink 的 Row
类型等允许嵌套且有多个可在表的表达式中访问的字段的复合数据类型。其他类型被视为原子类型。 Composite types such as Tuples
(built-in Scala and Flink Java tuples), POJOs, Scala case classes, and Flink's
Row type allow for nested data structures with multiple fields that can be
accessed in table expressions. 下面,我们讨论 Table API 如何将这些数据类型类型转换为内部 row
表示形式,并提供将流数据集转换成表的样例。
-The mapping of a data type to a table schema can happen in two ways: **based
on the field positions** or **based on the field names**.
+数据类型到 table schema 的映射有两种方式:**基于字段位置**或**基于字段名称**。
-**Position-based Mapping**
+**基于位置映射**
-Position-based mapping can be used to give fields a more meaningful name while
keeping the field order. This mapping is available for composite data types
*with a defined field order* as well as atomic types. Composite data types such
as tuples, rows, and case classes have such a field order. However, fields of a
POJO must be mapped based on the field names (see next section). Fields can be
projected out but can't be renamed using an alias `as`.
+基于位置的映射可在保持字段顺序的同时为字段提供更有意义的名称。这种映射方式可用于*具有确定的字段顺序*的复合数据类型以及原子类型。如 tuple、row
以及 case class 这些复合数据类型都有这样的字段顺序。然而,POJO
类型的字段则必须通过名称映射(参见下一章)。可以将字段投影出来,但不能使用`as`重命名。
-When defining a position-based mapping, the specified names must not exist in
the input data type, otherwise the API will assume that the mapping should
happen based on the field names. If no field names are specified, the default
field names and field order of the composite type are used or `f0` for atomic
types.
+定义基于位置的映射时,输入数据类型中一定不能存在指定的名称,否则 API
会假定应该基于字段名称进行映射。如果未指定任何字段名称,则使用默认的字段名称和复合数据类型的字段顺序,或者使用 “ f0” 表示原子类型。
Review comment:
“ f0” -> `f0`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services