danny0405 commented on a change in pull request #11190: [FLINK-16089][docs] Translate "Data Type" page of "Table API & SQL" into Chinese URL: https://github.com/apache/flink/pull/11190#discussion_r383753317
########## File path: docs/dev/table/types.zh.md ########## @@ -22,62 +22,47 @@ specific language governing permissions and limitations under the License. --> -Due to historical reasons, before Flink 1.9, Flink's Table & SQL API data types were -tightly coupled to Flink's `TypeInformation`. `TypeInformation` is used in the DataStream -and DataSet API and is sufficient to describe all information needed to serialize and -deserialize JVM-based objects in a distributed setting. +由于历史原因,在 Flink 1.9 之前,Flink Table & SQL API 的数据类型与 Flink 的 `TypeInformation` 耦合紧密。`TypeInformation` 在 DataStream 和 DataSet API 中被使用,并且大量地用于描述分布式环境中 JVM 对象的序列化和反序列化操作所需的全部信息。 -However, `TypeInformation` was not designed to represent logical types independent of -an actual JVM class. In the past, it was difficult to map SQL standard types to this -abstraction. Furthermore, some types were not SQL-compliant and introduced without a -bigger picture in mind. +然而,`TypeInformation` 并不是被设计为表示独立于 JVM 类型的逻辑类型。之前很难将 SQL 的标准类型和这种抽象逻辑类型之间建立映射。此外,有一些类型并不是兼容 SQL 的并且在没有更好的规划的时候被引进。 -Starting with Flink 1.9, the Table & SQL API will receive a new type system that serves as a long-term -solution for API stability and standard compliance. +从 Flink 1.9 开始,Table & SQL API 将接收一种新的类型系统,作为维护 API 稳定性和标准符合性的长期解决方案。 -Reworking the type system is a major effort that touches almost all user-facing interfaces. Therefore, its -introduction spans multiple releases, and the community aims to finish this effort by Flink 1.10. +重新设计类型系统是一项涉及几乎所有的面向用户接口的重大工作。因此,它的引入跨越多个版本,社区的目标是在 Flink 1.10 完成这项工作。 -Due to the simultaneous addition of a new planner for table programs (see [FLINK-11439](https://issues.apache.org/jira/browse/FLINK-11439)), -not every combination of planner and data type is supported. Furthermore, planners might not support every -data type with the desired precision or parameter. +同时由于为 Table 编程添加了新的 Planner(见 [FLINK-11439](https://issues.apache.org/jira/browse/FLINK-11439)), 因此并不支持新旧 Planner 和数据类型的全部组合。此外,这些 Planner 可能不会支持每一个数据类型所需的精度或参数。 -<span class="label label-danger">Attention</span> Please see the planner compatibility table and limitations -section before using a data type. +<span class="label label-danger">注意</span> 在使用数据类型之前请参阅 Planner 的兼容性表和局限性章节。 * This will be replaced by the TOC {:toc} -Data Type +数据类型 --------- -A *data type* describes the logical type of a value in the table ecosystem. It can be used to declare input and/or -output types of operations. +*数据类型* 描述 Table 编程环境中的值的逻辑类型。它可以被用来声明操作的输入输出类型。 -Flink's data types are similar to the SQL standard's *data type* terminology but also contain information -about the nullability of a value for efficient handling of scalar expressions. +Flink 的数据类型和 SQL 标准的 *数据类型* 术语类似,但也包含有关可空值的信息,以便有效地处理标量表达式(Scalar Expressions)。 -Examples of data types are: +数据类型的示例: - `INT` - `INT NOT NULL` - `INTERVAL DAY TO SECOND(3)` - `ROW<myField ARRAY<BOOLEAN>, myOtherField TIMESTAMP(3)>` -A list of all pre-defined data types can be found [below](#list-of-data-types). +全部的预定义数据类型见[下面](#数据类型列表)列表。 -### Data Types in the Table API +### Table API 的数据类型 -Users of the JVM-based API work with instances of `org.apache.flink.table.types.DataType` within the Table API or when -defining connectors, catalogs, or user-defined functions. +JVM API 的用户可以在 Table API 中使用 `org.apache.flink.table.types.DataType` 的实例,以及定义连接器(Connector)、Catalog 或者用户自定义函数(User-Defined Function)。 -A `DataType` instance has two responsibilities: -- **Declaration of a logical type** which does not imply a concrete physical representation for transmission -or storage but defines the boundaries between JVM-based languages and the table ecosystem. -- *Optional:* **Giving hints about the physical representation of data to the planner** which is useful at the edges to other APIs . +一个 `DataType` 实例有两个作用: +- **逻辑类型的声明**,它并不表示传输或存储的具体物理含义,但是定义了基于 JVM 的语言和 Table 编程环境之间的边界。 +- *可选的:* **向 Planner 提供有关数据的物理表示的提示**,这对于其他 API 很有用。 Review comment: 它并不表示传输或存储的具体物理含义 -> 它不表达具体物理类型的存储和转换 ---------------------------------------------------------------- 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
