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 2021/01/26 12:16:55 UTC

[GitHub] [flink] fsk119 commented on a change in pull request #14710: [FLINK-19393][docs-zh] Translate the 'SQL Hints' page of 'Table API & SQL' into Chinese

fsk119 commented on a change in pull request #14710:
URL: https://github.com/apache/flink/pull/14710#discussion_r564455050



##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -63,24 +54,25 @@ val:
 
 {% endhighlight %}
 
-### Examples
+<a name="examples"></a>
+### 示例
 
 {% highlight sql %}
 
 CREATE TABLE kafka_table1 (id BIGINT, name STRING, age INT) WITH (...);
 CREATE TABLE kafka_table2 (id BIGINT, name STRING, age INT) WITH (...);
 
--- override table options in query source
+-- 在查询源中覆盖表选项

Review comment:
       覆盖查询语句中源表的选项

##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -63,24 +54,25 @@ val:
 
 {% endhighlight %}
 
-### Examples
+<a name="examples"></a>
+### 示例
 
 {% highlight sql %}
 
 CREATE TABLE kafka_table1 (id BIGINT, name STRING, age INT) WITH (...);
 CREATE TABLE kafka_table2 (id BIGINT, name STRING, age INT) WITH (...);
 
--- override table options in query source
+-- 在查询源中覆盖表选项
 select id, name from kafka_table1 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */;
 
--- override table options in join
+-- 在 join 中覆盖表选项
 select * from
     kafka_table1 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */ t1
     join
     kafka_table2 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */ t2
     on t1.id = t2.id;
 
--- override table options for INSERT target table
+-- 对 INSERT 目标表使用覆盖表选项

Review comment:
       覆盖插入语句中结果表的选项
   
   

##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -63,24 +54,25 @@ val:
 
 {% endhighlight %}
 
-### Examples
+<a name="examples"></a>
+### 示例
 
 {% highlight sql %}
 
 CREATE TABLE kafka_table1 (id BIGINT, name STRING, age INT) WITH (...);
 CREATE TABLE kafka_table2 (id BIGINT, name STRING, age INT) WITH (...);
 
--- override table options in query source
+-- 在查询源中覆盖表选项
 select id, name from kafka_table1 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */;
 
--- override table options in join
+-- 在 join 中覆盖表选项

Review comment:
       覆盖 join 中源表的选项
   
   

##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -25,34 +25,25 @@ under the License.
 * This will be replaced by the TOC
 {:toc}
 
-SQL hints can be used with SQL statements to alter execution plans. This chapter explains how to use hints to force various approaches.
-
-Generally a hint can be used to:
-
-- Enforce planner: there's no perfect planner, so it makes sense to implement hints to
-allow user better control the execution;
-- Append meta data(or statistics): some statistics like “table index for scan” and
-“skew info of some shuffle keys” are somewhat dynamic for the query, it would be very
-convenient to config them with hints because our planning metadata from the planner is very
-often not that accurate;
-- Operator resource constraints: for many cases, we would give a default resource
-configuration for the execution operators, i.e. min parallelism or
-managed memory (resource consuming UDF) or special resource requirement (GPU or SSD disk)
-and so on, it would be very flexible to profile the resource with hints per query(instead of the Job).
-
-## Dynamic Table Options
-Dynamic table options allows to specify or override table options dynamically, different with static table options defined with SQL DDL or connect API, 
-these options can be specified flexibly in per-table scope within each query.
-
-Thus it is very suitable to use for the ad-hoc queries in interactive terminal, for example, in the SQL-CLI,
-you can specify to ignore the parse error for a CSV source just by adding a dynamic option `/*+ OPTIONS('csv.ignore-parse-errors'='true') */`.
-
-<b>Note:</b> Dynamic table options default is forbidden to use because it may change the semantics of the query.
-You need to set the config option `table.dynamic-table-options.enabled` to be `true` explicitly (default is false),
-See the <a href="{% link dev/table/config.zh.md %}">Configuration</a> for details on how to set up the config options.
-
-### Syntax
-In order to not break the SQL compatibility, we use the Oracle style SQL hint syntax:
+可以将 SQL 提示(hints)与 SQL 语句一起使用改变执行计划(execution plans)。本章介绍如何使用 SQL 提示增强各种方法。
+
+SQL 提示一般可以用于以下:
+
+- Enforce planner:没有十分契合的 planner,所以实现提示让用户更好地控制执行是十分有意义的;
+- 增加元数据(或者统计信息):如 "table index for scan" 和 "skew info of some shuffle keys" 的一些统计数据对于查询来说是动态的,用提示来配置它们会非常方便,因为我们从 planner 获得的计划元数据通常不那么准确;

Review comment:
       Please also translate the "table index for scan" and "skew info of some shuffle keys".
   
   

##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -25,34 +25,25 @@ under the License.
 * This will be replaced by the TOC
 {:toc}
 
-SQL hints can be used with SQL statements to alter execution plans. This chapter explains how to use hints to force various approaches.
-
-Generally a hint can be used to:
-
-- Enforce planner: there's no perfect planner, so it makes sense to implement hints to
-allow user better control the execution;
-- Append meta data(or statistics): some statistics like “table index for scan” and
-“skew info of some shuffle keys” are somewhat dynamic for the query, it would be very
-convenient to config them with hints because our planning metadata from the planner is very
-often not that accurate;
-- Operator resource constraints: for many cases, we would give a default resource
-configuration for the execution operators, i.e. min parallelism or
-managed memory (resource consuming UDF) or special resource requirement (GPU or SSD disk)
-and so on, it would be very flexible to profile the resource with hints per query(instead of the Job).
-
-## Dynamic Table Options
-Dynamic table options allows to specify or override table options dynamically, different with static table options defined with SQL DDL or connect API, 
-these options can be specified flexibly in per-table scope within each query.
-
-Thus it is very suitable to use for the ad-hoc queries in interactive terminal, for example, in the SQL-CLI,
-you can specify to ignore the parse error for a CSV source just by adding a dynamic option `/*+ OPTIONS('csv.ignore-parse-errors'='true') */`.
-
-<b>Note:</b> Dynamic table options default is forbidden to use because it may change the semantics of the query.
-You need to set the config option `table.dynamic-table-options.enabled` to be `true` explicitly (default is false),
-See the <a href="{% link dev/table/config.zh.md %}">Configuration</a> for details on how to set up the config options.
-
-### Syntax
-In order to not break the SQL compatibility, we use the Oracle style SQL hint syntax:
+可以将 SQL 提示(hints)与 SQL 语句一起使用改变执行计划(execution plans)。本章介绍如何使用 SQL 提示增强各种方法。

Review comment:
       I think it's better to not translate the word `hints`. After I search with key words `sql hints` in baidu.com, I get more results about auto complete.
   
   I think it's better to translate to 
   
   ```
   SQL hints 是和SQL语句一起使用来改变执行计划的。
   ```

##########
File path: docs/dev/table/sql/hints.zh.md
##########
@@ -25,34 +25,25 @@ under the License.
 * This will be replaced by the TOC
 {:toc}
 
-SQL hints can be used with SQL statements to alter execution plans. This chapter explains how to use hints to force various approaches.
-
-Generally a hint can be used to:
-
-- Enforce planner: there's no perfect planner, so it makes sense to implement hints to
-allow user better control the execution;
-- Append meta data(or statistics): some statistics like “table index for scan” and
-“skew info of some shuffle keys” are somewhat dynamic for the query, it would be very
-convenient to config them with hints because our planning metadata from the planner is very
-often not that accurate;
-- Operator resource constraints: for many cases, we would give a default resource
-configuration for the execution operators, i.e. min parallelism or
-managed memory (resource consuming UDF) or special resource requirement (GPU or SSD disk)
-and so on, it would be very flexible to profile the resource with hints per query(instead of the Job).
-
-## Dynamic Table Options
-Dynamic table options allows to specify or override table options dynamically, different with static table options defined with SQL DDL or connect API, 
-these options can be specified flexibly in per-table scope within each query.
-
-Thus it is very suitable to use for the ad-hoc queries in interactive terminal, for example, in the SQL-CLI,
-you can specify to ignore the parse error for a CSV source just by adding a dynamic option `/*+ OPTIONS('csv.ignore-parse-errors'='true') */`.
-
-<b>Note:</b> Dynamic table options default is forbidden to use because it may change the semantics of the query.
-You need to set the config option `table.dynamic-table-options.enabled` to be `true` explicitly (default is false),
-See the <a href="{% link dev/table/config.zh.md %}">Configuration</a> for details on how to set up the config options.
-
-### Syntax
-In order to not break the SQL compatibility, we use the Oracle style SQL hint syntax:
+可以将 SQL 提示(hints)与 SQL 语句一起使用改变执行计划(execution plans)。本章介绍如何使用 SQL 提示增强各种方法。
+
+SQL 提示一般可以用于以下:
+
+- Enforce planner:没有十分契合的 planner,所以实现提示让用户更好地控制执行是十分有意义的;

Review comment:
       enforce planner -> 增强planner
   
   perfect -> 完美。
   
   实现提示让用户 -> 通过提示,用户
   
   这里主要是表达 任何优化都可能有bad case,需要人手动优化。




----------------------------------------------------------------
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.

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