Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" into Chinese' #20724

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

coder-zjh
Copy link

What is the purpose of the change

(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)

Brief change log

(for example:)

  • The TaskInfo is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • TaskManagers retrieve the TaskInfo from the blob cache

Verifying this change

Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (100MB)
  • Extended integration test for recovery after master (JobManager) failure
  • Added test that validates that TaskInfo is transferred only once across recoveries
  • Manually verified the change by running a 4 node cluster with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 31, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

.idea/vcs.xml Outdated
@@ -22,4 +22,4 @@
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/docs/themes/book" vcs="Git" />
</component>
</project>
</project>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we shouldn't change vcs.xml file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,I don't know when this file changed and I still committed it...


The type can be declared using `CHAR(n)` where `n` is the number of code points. `n` must have a value between `1`
and `2,147,483,647` (both inclusive). If no length is specified, `n` is equal to `1`.
可以使用 `CHAR(n)` 声明该类型,其中n表示其长度,`n` 的取值范围为 `1` 到 `2,147,483,647` (包括两数在内) ,如果没有指定`n` 的值,n 等于 1。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其中 n 表示其长度

There should be two spaces between Chinese characters and English characters.

@ChengkaiYang2022
Copy link
Contributor

ChengkaiYang2022 commented Sep 1, 2022

Please change the title to '[FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" in to Chinese'
and the git message should start with '[FLINK-27291][docs-zh]'.

@coder-zjh coder-zjh changed the title Datatypes translate [FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" in to Chinese' Sep 1, 2022
Copy link
Contributor

@ChengkaiYang2022 ChengkaiYang2022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coder-zjh Thanks for the contributions!

There are still some problems, mainly including space problems and grammatical problems, in the previous works. And I believe that they would be confusing for the users.

I left some comments before line 1180. Please take a look and it would be better if you help to polish the rest of the document.

{{< 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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API 的数据类型详见:

Space between English character and Chinese character.

@@ -333,11 +325,11 @@ DataTypes.VARBINARY(n)
DataTypes.BYTES()
```

**Bridging to JVM Types**
**JVM Types桥接**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space problems too.

@@ -444,10 +433,9 @@ DataTypes.TINYINT()
{{< /tabs >}}

#### `SMALLINT`
2字节的有符号整数类型,存储`-32,768` 到 `32,767` 的整数。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space problems too.

@@ -476,10 +464,9 @@ DataTypes.SMALLINT()
{{< /tabs >}}

#### `INT`
4字节的有符号整数类型,存储 `-2,147,483,648` 到 `2,147,483,647` 的整数。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space problems too.

`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>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t ARRAY 是更接近 SQL 标准的同义词。 例如,INT ARRAY 是相当于ARRAY。
->
为了更接近 SQL 标准,也可以使用 t ARRAY 的写法表达,比如,INT ARRAY 等同于 ARRAY。


A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks.
字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous work of the contributor is not clear enough.


A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks.
字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。
与 SQL 标准相比,可选的字段描述简化了复杂的处理 结构。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与 SQL 标准相比,可选的字段描述可以简化复杂结构的处理过程。

A row type is similar to the `STRUCT` type known from other non-standard-compliant frameworks.
字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。
与 SQL 标准相比,可选的字段描述简化了复杂的处理 结构。
行类型类似于其他非标准兼容框架中已知的`STRUCT`类型。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Row 类型类似于其他非标准兼容框架中的 STRUCT 类型。


`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`是字段的描述。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以使用 ROW<n0 t0 'd0', n1 t1 'd1', ...> 声明类型,其中 n 代表一个字段,t 是字段的逻辑类型,d 是字段的描述。

`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>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ROW(...) 是为更接近 SQL 标准而使用的同义写法。 例如,ROW(myField INT, myOtherField BOOLEAN) 等同于 ROW<myField INT, myOtherField BOOLEAN>

@coder-zjh coder-zjh changed the title [FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" in to Chinese' [FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" into Chinese' Sep 3, 2022
{{< /tab >}}
{{< tab "Python" >}}
For the Python Table API, those types are available in `pyflink.table.types.DataTypes`.
Python Table API, 的数据类型详见: `pyflink.table.types.DataTypes`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要删除 API 后的逗号

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i gonna fix it.

| `FLOAT` | |
| `DOUBLE` | |
| `DATE` | |
| `TIME` | 仅支持到0.的精度。 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"仅支持到0.的精度" -> "仅支持精度为 0"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants