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
base: master
Are you sure you want to change the base?
Conversation
… "Data Types" in to Chinese
.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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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。 |
There was a problem hiding this comment.
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.
Please change the title to '[FLINK-27291][docs-zh] Translate the "List of Data Types" section of "Data Types" in to Chinese' |
There was a problem hiding this 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`. |
There was a problem hiding this comment.
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桥接** |
There was a problem hiding this comment.
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` 的整数。 |
There was a problem hiding this comment.
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` 的整数。 |
There was a problem hiding this comment.
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>`。 |
There was a problem hiding this comment.
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. | ||
字段由字段名称、字段类型和可选描述组成。 最具体的类型 表的一行是行类型。 在这种情况下,行的每一列对应于字段 与列具有相同序号位置的行类型。 |
There was a problem hiding this comment.
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 标准相比,可选的字段描述简化了复杂的处理 结构。 |
There was a problem hiding this comment.
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`类型。 |
There was a problem hiding this comment.
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`是字段的描述。 |
There was a problem hiding this comment.
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>`。 |
There was a problem hiding this comment.
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>
。
{{< /tab >}} | ||
{{< tab "Python" >}} | ||
For the Python Table API, those types are available in `pyflink.table.types.DataTypes`. | ||
Python Table API, 的数据类型详见: `pyflink.table.types.DataTypes`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要删除 API 后的逗号
There was a problem hiding this comment.
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.的精度。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"仅支持到0.的精度" -> "仅支持精度为 0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
line 153: comma problem line 176: confusing translation
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:)
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:)
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation