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-25761] [docs] Translate Avro format page into Chinese. #18641

Merged
merged 7 commits into from
Feb 25, 2022

Conversation

MrWhiteSike
Copy link
Contributor

@MrWhiteSike MrWhiteSike commented Feb 7, 2022

What is the purpose of the change

Translate Avro format page into Chinese.

Brief change log

  • file location: flink/docs/content.zh/docs/connectors/datastream/formats/avro.md

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 Feb 7, 2022

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 4b24b89 (Mon Feb 07 09:12:01 UTC 2022)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • This pull request references an unassigned Jira ticket. According to the code contribution guide, tickets need to be assigned before starting with the implementation work.

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 7, 2022

CI report:

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

@MrWhiteSike
Copy link
Contributor Author

@flinkbot run Azure

Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

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

@MrWhiteSike Thanks for the translation.
Could you review it by yourself based on the experience of your first PR before the next review ?
Looking forward to it.

@MrWhiteSike
Copy link
Contributor Author

@RocMarshal Thanks for the comment. I will review it based on the experience of My first PR!

@MrWhiteSike
Copy link
Contributor Author

@RocMarshal Would you mind helping to review it again? Thx

Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

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

@MrWhiteSike it looks very good on the whole. I left some minor comments. Please let me know what do you think of it.


```java
usersDS.keyBy("name")
```


Note that using the `GenericData.Record` type is possible with Flink, but not recommended. Since the record contains the full schema, its very data intensive and thus probably slow to use.
注意,在 Flink 中可能会使用 `GenericData.Record` 类型,但是不推荐使用。由于该类型的记录中包含了完整的 schema,导致数据非常密集,使用起来可能很慢。
Copy link
Contributor

Choose a reason for hiding this comment

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

可能会->可以

由于->因为


Flink's POJO field selection also works with POJOs generated from Avro. However, the usage is only possible if the field types are written correctly to the generated class. If a field is of type `Object` you can not use the field as a join or grouping key.
Specifying a field in Avro like this `{"name": "type_double_test", "type": "double"},` works fine, however specifying it as a UNION-type with only one field (`{"name": "type_double_test", "type": ["double"]},`) will generate a field of type `Object`. Note that specifying nullable types (`{"name": "type_double_test", "type": ["null", "double"]},`) is possible!
Flink 中在 Avro schema 生成的 POJO 类上也可以进行 POJO 字段选择。因此,只有在生成的类中正确写入字段类型时,才可以使用字段选择。如果一个字段类型是 `Object` 类型,你不可以选择该字段进行 join 或者 group by 操作。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Flink 中在 Avro schema 生成的 POJO 类上也可以进行 POJO 字段选择。因此,只有在生成的类中正确写入字段类型时,才可以使用字段选择。如果一个字段类型是 `Object` 类型,你不可以选择该字段进行 join 或者 group by 操作
Flink 的 POJO 字段选择也适用于从 Avro schema 生成的 POJO 类。但是,只有将字段类型正确写入生成的类时,才能使用。如果字段是 `Object` 类型,则不能将该字段用作 join 键或 grouping 键

Flink's POJO field selection also works with POJOs generated from Avro. However, the usage is only possible if the field types are written correctly to the generated class. If a field is of type `Object` you can not use the field as a join or grouping key.
Specifying a field in Avro like this `{"name": "type_double_test", "type": "double"},` works fine, however specifying it as a UNION-type with only one field (`{"name": "type_double_test", "type": ["double"]},`) will generate a field of type `Object`. Note that specifying nullable types (`{"name": "type_double_test", "type": ["null", "double"]},`) is possible!
Flink 中在 Avro schema 生成的 POJO 类上也可以进行 POJO 字段选择。因此,只有在生成的类中正确写入字段类型时,才可以使用字段选择。如果一个字段类型是 `Object` 类型,你不可以选择该字段进行 join 或者 group by 操作。
Avro 中类似 `{"name": "type_double_test", "type": "double"},` 这样指定字段是可行的,但是类似 (`{"name": "type_double_test", "type": ["double"]},`) 这样指定字段,字段类型就会生成为 `Object` 类型。注意,类似 (`{"name": "type_double_test", "type": ["null", "double"]},`) 这样指定 nullable 类型字段,也是有可能的!
Copy link
Contributor

Choose a reason for hiding this comment

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

在 Avro 中如 `{"name": "type_double_test", "type": "double"},` 这样指定字段是可行的,但是如 (`{"name": "type_double_test", "type": ["double"]},`) 这样指定包含一个字段的复合类型就会生成 `Object` 类型的字段。注意,如 (`{"name": "type_double_test", "type": ["null", "double"]},`) 这样指定 nullable 类型字段也是可能产生 `Object` 类型的!

@MrWhiteSike
Copy link
Contributor Author

@RocMarshal Thanks for the comments.I updated this pr based on your comments. Please review it again. Thanks

Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

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

Thanks for the update. LGTM +1(non-binding)

@wuchong Would you mind making the final check on it ? Thanks a lot.

@wuchong wuchong merged commit c511c9a into apache:master Feb 25, 2022
JasonLeeCoding pushed a commit to JasonLeeCoding/flink that referenced this pull request May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants