ChengkaiYang2022 commented on code in PR #20724: URL: https://github.com/apache/flink/pull/20724#discussion_r961662302
########## docs/content.zh/docs/dev/table/types.md: ########## @@ -333,11 +325,11 @@ DataTypes.VARBINARY(n) DataTypes.BYTES() ``` -**Bridging to JVM Types** +**JVM Types桥接** Review Comment: Space problems too. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -142,56 +142,54 @@ val t: DataType = DataTypes.ARRAY(DataTypes.INT().notNull()).bridgedTo(classOf[A API is extended. Users of predefined sources/sinks/functions do not need to define such hints. Hints within a table program (e.g. `field.cast(TIMESTAMP(3).bridgedTo(Timestamp.class))`) are ignored. -List of Data Types +数据类型列表 ------------------ - -This section lists all pre-defined data types. +这部分列举了所有预定义的数据类型。 {{< tabs "datatypesimport" >}} {{< tab "Java/Scala" >}} -For the JVM-based Table API those types are also available in `org.apache.flink.table.api.DataTypes`. +Java/Scala Table API的数据类型详见: `org.apache.flink.table.api.DataTypes`. Review Comment: API 的数据类型详见: Space between English character and Chinese character. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -444,10 +433,9 @@ DataTypes.TINYINT() {{< /tabs >}} #### `SMALLINT` +2字节的有符号整数类型,存储`-32,768` 到 `32,767` 的整数。 Review Comment: Space problems too. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1095,22 +1049,17 @@ DataTypes.ARRAY(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ARRAY<t>` where `t` is the data type of the contained -elements. -`t ARRAY` is a synonym for being closer to the SQL standard. For example, `INT ARRAY` is -equivalent to `ARRAY<INT>`. +可以使用 `ARRAY<t>` 声明类型,`t` 是其中元素的数据类型。。 +`t ARRAY` 是更接近 SQL 标准的同义词。 例如,`INT ARRAY` 是相当于`ARRAY<INT>`。 Review Comment: t ARRAY 是更接近 SQL 标准的同义词。 例如,INT ARRAY 是相当于ARRAY<INT>。 -> 为了更接近 SQL 标准,也可以使用 t ARRAY 的写法表达,比如,INT ARRAY 等同于 ARRAY<INT>。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -751,51 +729,45 @@ TIMESTAMP(p) WITHOUT TIME ZONE DataTypes.TIMESTAMP(p) ``` -**Bridging to JVM Types** +**JVM Types桥接** Review Comment: Space problems. Please check the space problems in the rest of the contents. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1095,22 +1049,17 @@ DataTypes.ARRAY(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ARRAY<t>` where `t` is the data type of the contained -elements. -`t ARRAY` is a synonym for being closer to the SQL standard. For example, `INT ARRAY` is -equivalent to `ARRAY<INT>`. +可以使用 `ARRAY<t>` 声明类型,`t` 是其中元素的数据类型。。 +`t ARRAY` 是更接近 SQL 标准的同义词。 例如,`INT ARRAY` 是相当于`ARRAY<INT>`。 #### `MAP` -Data type of an associative array that maps keys (including `NULL`) to values (including `NULL`). A map -cannot contain duplicate keys; each key can map to at most one value. - -There is no restriction of element types; it is the responsibility of the user to ensure uniqueness. - -The map type is an extension to the SQL standard. - -**Declaration** +将键(包括“NULL”)映射到值(包括“NULL”)的关联数组的数据类型。 +1个map中不能包含重复的键; 每个键最多可以映射到一个值。 Review Comment: map 中不能包含重复的键;每个键最多可以映射到一个值。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1139,17 +1088,16 @@ DataTypes.MAP(kt, vt) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MAP<kt, vt>` where `kt` is the data type of the key elements -and `vt` is the data type of the value elements. +可以使用 `MAP<kt, vt>` 声明类型,其中 `kt` 是关键元素的数据类型 ,并且 `vt` 是值元素的数据类型。 Review Comment: 可以使用 `MAP<kt, vt>` 声明类型,其中 `kt` 是键的数据类型 ,并且 `vt` 是值的数据类型。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1163,13 +1111,13 @@ t MULTISET DataTypes.MULTISET(t) ``` -**Bridging to JVM Types** +**JVM Types桥接** -| Java Type | Input | Output | Remarks | +| Java Type | 输入 | 输出 | 备注 | |:--------------------------------------|:-----:|:------:|:---------------------------------------------------------| -|`java.util.Map<t, java.lang.Integer>` | X | X | Assigns each value to an integer multiplicity. *Default* | +|`java.util.Map<t, java.lang.Integer>` | X | X | 将每个值分配给整数倍数。 *默认* | Review Comment: This is confusing, I'm not sure what this means if I was the reader. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1139,17 +1088,16 @@ DataTypes.MAP(kt, vt) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MAP<kt, vt>` where `kt` is the data type of the key elements -and `vt` is the data type of the value elements. +可以使用 `MAP<kt, vt>` 声明类型,其中 `kt` 是关键元素的数据类型 ,并且 `vt` 是值元素的数据类型。 Review Comment: Please be sure use 'map' or 'MAP'. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1179,26 +1127,21 @@ DataTypes.MULTISET(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MULTISET<t>` where `t` is the data type -of the contained elements. -`t MULTISET` is a synonym for being closer to the SQL standard. For example, `INT MULTISET` is -equivalent to `MULTISET<INT>`. +可以使用 `MULTISET<t>` 声明类型,其中 `t` 是数据类型 所包含的元素。 +`t MULTISET` 是更接近 SQL 标准的同义词。 例如,`INT MULTISET` 相当于`MULTISET<INT>`。 Review Comment: `t MULTISET` 是为更接近 SQL 标准而使用的同义写法。 例如,`INT MULTISET` 等同于`MULTISET<INT>`。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1179,26 +1127,21 @@ DataTypes.MULTISET(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MULTISET<t>` where `t` is the data type -of the contained elements. -`t MULTISET` is a synonym for being closer to the SQL standard. For example, `INT MULTISET` is -equivalent to `MULTISET<INT>`. +可以使用 `MULTISET<t>` 声明类型,其中 `t` 是数据类型 所包含的元素。 +`t MULTISET` 是更接近 SQL 标准的同义词。 例如,`INT MULTISET` 相当于`MULTISET<INT>`。 -#### `ROW` -Data type of a sequence of fields. +#### `ROW` -A field consists of a field name, field type, and an optional description. The most specific type -of a row of a table is a row type. In this case, each column of the row corresponds to the field -of the row type that has the same ordinal position as the column. -Compared to the SQL standard, an optional field description simplifies the handling with complex -structures. +字段序列的数据类型。 -A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks. +字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。 Review Comment: The previous work of the contributor is not clear enough. And it also doesn't correct grammarly. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1232,67 +1175,55 @@ DataTypes.ROW([DataTypes.FIELD(n0, t0, d0), DataTypes.FIELD(n1, t1, d1), ...]) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ROW<n0 t0 'd0', n1 t1 'd1', ...>` where `n` is the unique name of -a field, `t` is the logical type of a field, `d` is the description of a field. -`ROW(...)` is a synonym for being closer to the SQL standard. For example, `ROW(myField INT, myOtherField BOOLEAN)` is -equivalent to `ROW<myField INT, myOtherField BOOLEAN>`. +可以使用 `ROW<n0 t0 'd0', n1 t1 'd1', ...>` 声明类型,其中 `n` 是一个字段,`t`是字段的逻辑类型,`d`是字段的描述。 +`ROW(...)` 是更接近 SQL 标准的同义词。 例如,`ROW(myField INT, myOtherField BOOLEAN)` 相当于`ROW<myField INT, myOtherField BOOLEAN>`。 Review Comment: `ROW(...)` 是为更接近 SQL 标准而使用的同义写法。 例如,`ROW(myField INT, myOtherField BOOLEAN)` 等同于 `ROW<myField INT, myOtherField BOOLEAN>`。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1179,26 +1127,21 @@ DataTypes.MULTISET(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MULTISET<t>` where `t` is the data type -of the contained elements. -`t MULTISET` is a synonym for being closer to the SQL standard. For example, `INT MULTISET` is -equivalent to `MULTISET<INT>`. +可以使用 `MULTISET<t>` 声明类型,其中 `t` 是数据类型 所包含的元素。 +`t MULTISET` 是更接近 SQL 标准的同义词。 例如,`INT MULTISET` 相当于`MULTISET<INT>`。 -#### `ROW` -Data type of a sequence of fields. +#### `ROW` -A field consists of a field name, field type, and an optional description. The most specific type -of a row of a table is a row type. In this case, each column of the row corresponds to the field -of the row type that has the same ordinal position as the column. -Compared to the SQL standard, an optional field description simplifies the handling with complex -structures. +字段序列的数据类型。 -A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks. +字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。 +与 SQL 标准相比,可选的字段描述简化了复杂的处理 结构。 +行类型类似于其他非标准兼容框架中已知的`STRUCT`类型。 Review Comment: Row 类型类似于其他非标准兼容框架中的 `STRUCT` 类型。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1179,26 +1127,21 @@ DataTypes.MULTISET(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MULTISET<t>` where `t` is the data type -of the contained elements. -`t MULTISET` is a synonym for being closer to the SQL standard. For example, `INT MULTISET` is -equivalent to `MULTISET<INT>`. +可以使用 `MULTISET<t>` 声明类型,其中 `t` 是数据类型 所包含的元素。 Review Comment: 可以使用 `MULTISET<t>` 声明类型,其中 `t` 是所包含元素的数据类型 。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -476,10 +464,9 @@ DataTypes.SMALLINT() {{< /tabs >}} #### `INT` +4字节的有符号整数类型,存储 `-2,147,483,648` 到 `2,147,483,647` 的整数。 Review Comment: Space problems too. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1095,22 +1049,17 @@ DataTypes.ARRAY(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ARRAY<t>` where `t` is the data type of the contained -elements. -`t ARRAY` is a synonym for being closer to the SQL standard. For example, `INT ARRAY` is -equivalent to `ARRAY<INT>`. +可以使用 `ARRAY<t>` 声明类型,`t` 是其中元素的数据类型。。 +`t ARRAY` 是更接近 SQL 标准的同义词。 例如,`INT ARRAY` 是相当于`ARRAY<INT>`。 #### `MAP` -Data type of an associative array that maps keys (including `NULL`) to values (including `NULL`). A map -cannot contain duplicate keys; each key can map to at most one value. - -There is no restriction of element types; it is the responsibility of the user to ensure uniqueness. - -The map type is an extension to the SQL standard. - -**Declaration** +将键(包括“NULL”)映射到值(包括“NULL”)的关联数组的数据类型。 +1个map中不能包含重复的键; 每个键最多可以映射到一个值。 +没有元素类型的限制; 确保唯一性是用户的责任。 Review Comment: 没有元素类型的限制 -》 元素类型没有限制;用户应确保其唯一性。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1139,17 +1088,16 @@ DataTypes.MAP(kt, vt) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MAP<kt, vt>` where `kt` is the data type of the key elements -and `vt` is the data type of the value elements. +可以使用 `MAP<kt, vt>` 声明类型,其中 `kt` 是关键元素的数据类型 ,并且 `vt` 是值元素的数据类型。 + #### `MULTISET` -Data type of a multiset (=bag). Unlike a set, it allows for multiple instances for each of its -elements with a common subtype. Each unique value (including `NULL`) is mapped to some multiplicity. +多重集 (=bag) 的数据类型。 与集合不同的是,它允许每个具有共同子类型的元素有多个实例。 每个唯一值(包括 NULL)都映射到某个多重性。 +没有元素类型的限制; 确保唯一性是用户的责任。 Review Comment: 元素类型没有限制;用户应确保其唯一性。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1095,22 +1049,17 @@ DataTypes.ARRAY(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ARRAY<t>` where `t` is the data type of the contained -elements. -`t ARRAY` is a synonym for being closer to the SQL standard. For example, `INT ARRAY` is -equivalent to `ARRAY<INT>`. +可以使用 `ARRAY<t>` 声明类型,`t` 是其中元素的数据类型。。 +`t ARRAY` 是更接近 SQL 标准的同义词。 例如,`INT ARRAY` 是相当于`ARRAY<INT>`。 #### `MAP` -Data type of an associative array that maps keys (including `NULL`) to values (including `NULL`). A map -cannot contain duplicate keys; each key can map to at most one value. - -There is no restriction of element types; it is the responsibility of the user to ensure uniqueness. - -The map type is an extension to the SQL standard. - -**Declaration** +将键(包括“NULL”)映射到值(包括“NULL”)的关联数组的数据类型。 +1个map中不能包含重复的键; 每个键最多可以映射到一个值。 Review Comment: Please be sure use 'map' or 'MAP'. ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1179,26 +1127,21 @@ DataTypes.MULTISET(t) {{< /tab >}} {{< /tabs >}} -The type can be declared using `MULTISET<t>` where `t` is the data type -of the contained elements. -`t MULTISET` is a synonym for being closer to the SQL standard. For example, `INT MULTISET` is -equivalent to `MULTISET<INT>`. +可以使用 `MULTISET<t>` 声明类型,其中 `t` 是数据类型 所包含的元素。 +`t MULTISET` 是更接近 SQL 标准的同义词。 例如,`INT MULTISET` 相当于`MULTISET<INT>`。 -#### `ROW` -Data type of a sequence of fields. +#### `ROW` -A field consists of a field name, field type, and an optional description. The most specific type -of a row of a table is a row type. In this case, each column of the row corresponds to the field -of the row type that has the same ordinal position as the column. -Compared to the SQL standard, an optional field description simplifies the handling with complex -structures. +字段序列的数据类型。 -A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks. +字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。 +与 SQL 标准相比,可选的字段描述简化了复杂的处理 结构。 Review Comment: 与 SQL 标准相比,可选的字段描述可以简化复杂结构的处理过程。 ########## docs/content.zh/docs/dev/table/types.md: ########## @@ -1232,67 +1175,55 @@ DataTypes.ROW([DataTypes.FIELD(n0, t0, d0), DataTypes.FIELD(n1, t1, d1), ...]) {{< /tab >}} {{< /tabs >}} -The type can be declared using `ROW<n0 t0 'd0', n1 t1 'd1', ...>` where `n` is the unique name of -a field, `t` is the logical type of a field, `d` is the description of a field. -`ROW(...)` is a synonym for being closer to the SQL standard. For example, `ROW(myField INT, myOtherField BOOLEAN)` is -equivalent to `ROW<myField INT, myOtherField BOOLEAN>`. +可以使用 `ROW<n0 t0 'd0', n1 t1 'd1', ...>` 声明类型,其中 `n` 是一个字段,`t`是字段的逻辑类型,`d`是字段的描述。 Review Comment: 可以使用 `ROW<n0 t0 'd0', n1 t1 'd1', ...>` 声明类型,其中 `n` 代表一个字段,`t` 是字段的逻辑类型,`d` 是字段的描述。 -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org