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-17005][docs] Translate the CREATE TABLE ... LIKE syntax documentation to Chinese #12313

Closed
wants to merge 3 commits into from

Conversation

yangyichao-mango
Copy link
Contributor

What is the purpose of the change

Translate the CREATE TABLE ... LIKE syntax documentation to Chinese

Brief change log

  • Updating the docs/dev/table/sql/create.zh.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/Mesos, 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

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 c225fa8 (Mon May 25 05:32:10 UTC 2020)

✅no warnings

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 May 25, 2020

CI report:

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

@klion26
Copy link
Member

klion26 commented May 25, 2020

@yangyichao-mango thanks for your contribution, could you please git rid of the "merge" commit? you can use "git rebase" instead

@yangyichao-mango
Copy link
Contributor Author

Thx. I've rebase that commit.

Copy link
Member

@klion26 klion26 left a comment

Choose a reason for hiding this comment

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

@yangyichao-mango thanks for your contribution, I left some comments
PS: for translation commit, we always use [docs-zh] instead of [docs]

@@ -208,14 +215,14 @@ CREATE TABLE Orders (

**注意:** 使用 `CREATE TABLE` 语句注册的表均可用作 table source 和 table sink。 在被 DML 语句引用前,我们无法决定其实际用于 source 抑或是 sink。

**LIKE clause**
**LIKE**
Copy link
Member

Choose a reason for hiding this comment

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

这里单纯的用 LIKE 会觉的不太完整

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里单纯的用 LIKE 会觉的不太完整

谢谢review~
这里我是为了和整小节的小标题以及create table中的like使用方式保持一致才这样写的,有想过写成【LIKE 子句】,但是个人感觉会比较突兀

**LIKE clause**
**LIKE**

`LIKE` 子句来源于两种 SQL 特性的变体/组合(Feature T171,“表定义中的LIKE语法” 和 Feature T173,“表定义中的LIKE语法扩展”)。LIKE 子句可以基于现有表的定义去创建新表,并且可以扩展或排除原始表中的某些部分。与 SQL 标准相反,LIKE 子句必须在 CREATE 语句中定义。这是因为 LIKE 子句可以应用于表定义的多个部分,而不仅仅是 schema 部分。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`LIKE` 子句来源于两种 SQL 特性的变体/组合(Feature T171,“表定义中的LIKE语法” 和 Feature T173,“表定义中的LIKE语法扩展”)。LIKE 子句可以基于现有表的定义去创建新表,并且可以扩展或排除原始表中的某些部分。与 SQL 标准相反,LIKE 子句必须在 CREATE 语句中定义。这是因为 LIKE 子句可以应用于表定义的多个部分,而不仅仅是 schema 部分。
`LIKE` 子句来源于两种 SQL 特性的变体/组合(Feature T171,“表定义中的 LIKE 语法” 和 Feature T173,“表定义中的 LIKE 语法扩展”)。LIKE 子句可以基于现有表的定义去创建新表,并且可以扩展或排除原始表中的某些部分。与 SQL 标准相反,LIKE 子句必须在 CREATE 语句中定义。这是因为 LIKE 子句可以应用于表定义的多个部分,而不仅仅是 schema 部分。

另外这里的实现细节我不是太清楚,但是从字面上看 “at the top-level of a CREATE statement" 这里翻译成”必须在 CREATE 语句中定义“,我比较好奇这里说的 ”top-level“ 是指什么意思呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

另外这里的实现细节我不是太清楚,但是从字面上看 “at the top-level of a CREATE statement" 这里翻译成”必须在 CREATE 语句中定义“,我比较好奇这里说的 ”top-level“ 是指什么意思呢?

这里的”top-level“我原本理解是用来形容create table的,类似于DDL对比与DML是”top-level“,所以我使用了“必须在 CREATE 语句中定义“这样的描述。
现在我有一些不同的理解:对比于create table,like字句是一个更上层的定义方式,这部分我之后再思考下。


The `LIKE` clause is a variant/combination of SQL features (Feature T171, “LIKE clause in table definition” and Feature T173, “Extended LIKE clause in table definition”). The clause can be used to create a table based on a definition of an existing table. Additionally, users
can extend the original table or exclude certain parts of it. In contrast to the SQL standard the clause must be defined at the top-level of a CREATE statement. That is because the clause applies to multiple parts of the definition and not only to the schema part.
你可以使用该子句,重用(或覆写)指定的连接器配置属性或者可以向外部表添加 watermark 定义,例如可以向 Apache Hive 中定义的表添加 watermark 定义。
Copy link
Member

Choose a reason for hiding this comment

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

个人意见:覆写 更像是繁体中文中的描述,这里如果用 改写 会好一些吗?(这里修改的话,其他地方也需要同步修改)
后面这句话的意思是不是说 “可以向哪些从 Apache Hive 读取的表增加 watermark”? 也就是说从 Hive 读取的,但是仅读取可能是没有 watermark 的,这里就可以增加 watermark

Copy link
Contributor Author

Choose a reason for hiding this comment

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

表的watermark定义也是可以使用like子句更改,所以这部分我理解指的不仅仅是读取可能是没有 watermark 的,我理解是无论是否定义过,都可以添加

* WATERMARKS - watermark declarations
* CONSTRAINTS - 主键和唯一键约束
* GENERATED - 计算列
* OPTIONS - 连接器和格式化的配置项
Copy link
Member

Choose a reason for hiding this comment

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

这里 format properties 翻译成 格式化的配置项 整句话连起来有点像 “连接器格式化的配置项” 有什么办法可以改进一下吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯嗯,这部分我再思考下


Additionally, you can use the `INCLUDING/EXCLUDING ALL` option to specify what should be the strategy if there was no specific strategy defined, i.e. if you use `EXCLUDING ALL INCLUDING WATERMARKS` only the watermarks will be included from the source table.
此外,如果没有特别指定合并策略,也可以使用 `INCLUDING/EXCLUDING ALL` 这种声明方式来指定使用怎样的合并策略,例如使用 `EXCLUDING ALL INCLUDING WATERMARKS`,那么代表只有源表的 WATERMARKS 属性才会被包含进新表。
Copy link
Member

Choose a reason for hiding this comment

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

这里的意思是不是说没有一些 “defined” 的策略,那么就可以用 INCLUDING/EXCLUDING ALL 类似的语法来描述,就像后面的例子一样。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是指可以使用,因为根据代码实现和使用方式来看,只能使用”INCLUDING/EXCLUDING ALL“这类方式来指定合并策略


**NOTE** You cannot control the behavior of merging physical fields. Those will be merged as if you applied the `INCLUDING` strategy.
**注意:** 您无法选择物理列的合并策略,当物理列进行合并时就如使用了 `INCLUDING` 策略。
Copy link
Member

Choose a reason for hiding this comment

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

这个有个小疑问,physical fields 就是指物理列吗?这个是和 逻辑列 对应的吗?另外在网上搜索发现 “物理列”这个描述好少

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是参考了当前章节中之前段落对这里的翻译是叫做”物理列“,我理解
物理列指的是表中物理存储的那些列
计算列是使用同一表中其他列的非查询表达式生成,并且不会在表中进行物理存储的列
这里是相互对应的。
如果我理解有问题,希望可以指正,感谢。

@yangyichao-mango
Copy link
Contributor Author

I've pushed a new commit to apply all of the suggestions.
Thx for review. @klion26

Copy link
Member

@klion26 klion26 left a comment

Choose a reason for hiding this comment

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

@yangyichao-mango thanks for addressing the comments, LGTM now,
maybe @wuchong can give a final review for this, he is more familiar with SQL than me.

CREATE TABLE Orders_in_file (
user BIGINT,
product STRING,
order_time_string STRING,
order_time AS to_timestamp(order_time)

Copy link
Member

Choose a reason for hiding this comment

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

这个无关的修改可以去掉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个无关的修改可以去掉

谢谢~,已修改。

@klion26
Copy link
Member

klion26 commented Jun 15, 2020

@yangyichao-mango Seems there are some conflicts need to be resolved, could you please rebase the new master to resolve them?

@yangyichao-mango
Copy link
Contributor Author

@yangyichao-mango Seems there are some conflicts need to be resolved, could you please rebase the new master to resolve them?

Thx a lot. I've resolved those conflicts.

@klion26
Copy link
Member

klion26 commented Jun 16, 2020

@yangyichao-mango thanks for the work, could you please use git rebase instead of git merge to resolve the conflict.

@yangyichao-mango
Copy link
Contributor Author

@yangyichao-mango thanks for the work, could you please use git rebase instead of git merge to resolve the conflict.

Thx a lot for your review. I've rebased the branch and resolve the conflicts.

Copy link
Member

@klion26 klion26 left a comment

Choose a reason for hiding this comment

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

@yangyichao-mango thanks for the work. LGTM now.
ping @wuchong @rmetzger

@wuchong
Copy link
Member

wuchong commented Jun 17, 2020

Thanks @yangyichao-mango and @klion26 , will merge this.

@wuchong wuchong closed this in f9615a4 Jun 17, 2020
wuchong pushed a commit that referenced this pull request Jun 17, 2020
bigdata-ny pushed a commit to bigdata-ny/flink that referenced this pull request Jun 19, 2020
zhangjun0x01 pushed a commit to zhangjun0x01/flink that referenced this pull request Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants