You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/20 07:22:18 UTC

[GitHub] [flink] jjiey opened a new pull request, #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

jjiey opened a new pull request, #20316:
URL: https://github.com/apache/flink/pull/20316

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   [FLINK-27292](https://issues.apache.org/jira/browse/FLINK-27292)
   Translate the "Data Type Extraction" section of "Data Types" to Chinese.
   
   ## Brief change log
   
   Translate the "Data Type Extraction" section of "Data Types" to Chinese, the doc file is located in
   'docs/content.zh/docs/dev/table/types.md'
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## 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**)
   


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] ChengkaiYang2022 commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
ChengkaiYang2022 commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1190430094

   @jjiey could you a add picture of the part you translate?
   Just like https://github.com/apache/flink/pull/19496#issuecomment-1115132533


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] jjiey commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
jjiey commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1189946818

   I finished the translation, and sorry that no one assigned this issue to me first.
   
   I have asked for [it](https://issues.apache.org/jira/browse/FLINK-27292), can @wuchong or @MartijnVisser assign this to me? thank you.


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] MartijnVisser merged pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
MartijnVisser merged PR #20316:
URL: https://github.com/apache/flink/pull/20316


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1189936301

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "16f30996a523add971f46ab5db048ee4a6f60774",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "16f30996a523add971f46ab5db048ee4a6f60774",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 16f30996a523add971f46ab5db048ee4a6f60774 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] jjiey commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
jjiey commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1194883817

   Thanks for @ChengkaiYang2022‘s review, I've finished the modification.


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] ChengkaiYang2022 commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
ChengkaiYang2022 commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1190108742

   @jjiey Thanks for the contribution! I will help to check it ASAP.


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] jjiey commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
jjiey commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1190976473

   > @jjiey could you a add picture of the part you translate? Just like [#19496 (comment)](https://github.com/apache/flink/pull/19496#issuecomment-1115132533)
   
   @ChengkaiYang2022 fine. here is the [link](http://localhost:1313/flink/flink-docs-master/zh/docs/dev/table/types/#%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E6%8F%90%E5%8F%96), and picture is as follows.
   <img width="916" alt="2022-07-21_10 43 00" src="https://user-images.githubusercontent.com/29424908/180118942-503f2bc0-201f-4663-aa52-2435172fa8f4.png">
   


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] jjiey commented on pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
jjiey commented on PR #20316:
URL: https://github.com/apache/flink/pull/20316#issuecomment-1189944176

   Hi @ChengkaiYang2022 , could you help to review this? thank you.


-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] ChengkaiYang2022 commented on a diff in pull request #20316: [FLINK-27292][docs-zh] Translate the "Data Type Extraction" section of "Data Types" to Chinese

Posted by GitBox <gi...@apache.org>.
ChengkaiYang2022 commented on code in PR #20316:
URL: https://github.com/apache/flink/pull/20316#discussion_r926561585


##########
docs/content.zh/docs/dev/table/types.md:
##########
@@ -1558,25 +1558,18 @@ COALESCE(TRY_CAST('non-number' AS INT), 0) --- 结果返回数字 0 的 INT 格
 在下一个版本,这个参数会被移除。
 {{< /hint >}}
 
-Data Type Extraction
+数据类型提取
 --------------------
 
 {{< tabs "extraction" >}}
 {{< tab "Java/Scala" >}}
-At many locations in the API, Flink tries to automatically extract data type from class information using
-reflection to avoid repetitive manual schema work. However, extracting a data type reflectively is not always
-successful because logical information might be missing. Therefore, it might be necessary to add additional
-information close to a class or field declaration for supporting the extraction logic.
+在 API 中的很多地方,Flink 都尝试使用反射从类信息中自动提取数据类型,以避免重复手动定义 schema 的工作。但是,通过反射提取数据类型并不总是有效,因为可能会缺失逻辑信息。因此,可能需要在类或字段声明的附近添加额外信息以支持提取逻辑。

Review Comment:
   在 API 中的很多地方,Flink 都尝试利用反射机制从类信息中自动提取数据类型,以避免重复地手动定义 schema 。但是,通过反射提取数据类型并不总是有效的,因为有可能会缺失逻辑信息。因此,可能需要在类或字段声明的附近添加额外信息以支持提取逻辑。



##########
docs/content.zh/docs/dev/table/types.md:
##########
@@ -1558,25 +1558,18 @@ COALESCE(TRY_CAST('non-number' AS INT), 0) --- 结果返回数字 0 的 INT 格
 在下一个版本,这个参数会被移除。
 {{< /hint >}}
 
-Data Type Extraction
+数据类型提取
 --------------------
 
 {{< tabs "extraction" >}}
 {{< tab "Java/Scala" >}}
-At many locations in the API, Flink tries to automatically extract data type from class information using
-reflection to avoid repetitive manual schema work. However, extracting a data type reflectively is not always
-successful because logical information might be missing. Therefore, it might be necessary to add additional
-information close to a class or field declaration for supporting the extraction logic.
+在 API 中的很多地方,Flink 都尝试使用反射从类信息中自动提取数据类型,以避免重复手动定义 schema 的工作。但是,通过反射提取数据类型并不总是有效,因为可能会缺失逻辑信息。因此,可能需要在类或字段声明的附近添加额外信息以支持提取逻辑。
 
-The following table lists classes that can be implicitly mapped to a data type without requiring further information.
+下表列出了无需更多信息即可隐式映射到数据类型的类。
 
-If you intend to implement classes in Scala, *it is recommended to use boxed types* (e.g. `java.lang.Integer`)
-instead of Scala's primitives. Scala's primitives (e.g. `Int` or `Double`) are compiled to JVM primitives (e.g.
-`int`/`double`) and result in `NOT NULL` semantics as shown in the table below. Furthermore, Scala primitives that
-are used in generics (e.g. `java.util.Map[Int, Double]`) are erased during compilation and lead to class
-information similar to `java.util.Map[java.lang.Object, java.lang.Object]`.
+如果你打算在 Scala 中实现类,*建议使用包装类型*(例如 `java.lang.Integer`)而不是 Scala 的基本类型。如下表所示,Scala 的基本类型(例如 `Int` 或 `Double`)被编译为 JVM 基本类型(例如 `int`/`double`)并产生 `NOT NULL` 语义。此外,在泛型中使用的 Scala 基本类型(例如 `java.util.Map[Int, Double]`)在编译期间会被抹去,导致类信息类似于 `java.util.Map[java.lang.Object, java.lang.Object]`。

Review Comment:
   如果你打算在 Scala 中实现类,*建议使用包装类型*(例如 `java.lang.Integer`)而不是 Scala 的基本类型。如下表所示,Scala 的基本类型(例如 `Int` 或 `Double`)会被编译为 JVM 基本类型(例如 `int`/`double`)并产生 `NOT NULL` 语义。此外,在泛型中使用的 Scala 基本类型时(例如 `java.util.Map[Int, Double]`),基本类型在编译期间会被抹去,导致类信息类似于 `java.util.Map[java.lang.Object, java.lang.Object]`。



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org