libenchao commented on a change in pull request #10822:
[FLINK-15081][docs-zh]Translate "Concepts & Common API" page of Table…
URL: https://github.com/apache/flink/pull/10822#discussion_r382676097
##########
File path: docs/dev/table/common.zh.md
##########
@@ -1406,54 +1385,54 @@ val table: Table = tableEnv.fromDataStream(stream,
'name as 'myName)
{% top %}
-Query Optimization
+查询优化
------------------
<div class="codetabs" markdown="1">
<div data-lang="Old planner" markdown="1">
-Apache Flink leverages Apache Calcite to optimize and translate queries. The
optimization currently performed include projection and filter push-down,
subquery decorrelation, and other kinds of query rewriting. Old planner does
not yet optimize the order of joins, but executes them in the same order as
defined in the query (order of Tables in the `FROM` clause and/or order of join
predicates in the `WHERE` clause).
+Apache Flink 利用 Apache Calcite
来优化和解析查询。当前执行的优化包括投影和过滤器下推,子查询去相关以及其他类型的查询重写。原版计划程序尚未优化 join
的顺序,而是按照查询中定义的顺序执行它们(FROM 子句中的表顺序和/或 WHERE 子句中的 join 谓词顺序)。
-It is possible to tweak the set of optimization rules which are applied in
different phases by providing a `CalciteConfig` object. This can be created via
a builder by calling `CalciteConfig.createBuilder())` and is provided to the
TableEnvironment by calling
`tableEnv.getConfig.setPlannerConfig(calciteConfig)`.
+通过提供一个 `CalciteConfig` 对象,可以调整在不同阶段应用的优化规则集合。这个对象可以通过调用构造器
`CalciteConfig.createBuilder()` 创建,并通过调用
`tableEnv.getConfig.setPlannerConfig(calciteConfig)` 提供给 TableEnvironment。
</div>
<div data-lang="Blink planner" markdown="1">
-Apache Flink leverages and extends Apache Calcite to perform sophisticated
query optimization.
-This includes a series of rule and cost-based optimizations such as:
+Apache Flink 使用并扩展了 Apache Calcite 来执行复杂的查询优化。
+这包括一系列基于规则和成本的优化,例如:
-* Subquery decorrelation based on Apache Calcite
-* Project pruning
-* Partition pruning
-* Filter push-down
-* Sub-plan deduplication to avoid duplicate computation
-* Special subquery rewriting, including two parts:
- * Converts IN and EXISTS into left semi-joins
- * Converts NOT IN and NOT EXISTS into left anti-join
-* Optional join reordering
- * Enabled via `table.optimizer.join-reorder-enabled`
+* 基于 Apache Calcite 的子查询解相关
+* 模型剪枝
+* 分区剪枝
+* 过滤器下推
+* 子计划消除重复数据以避免重复计算
+* 特殊子查询重写,包括两部分:
+ * 将 IN 和 EXISTS 转换为 left semi-joins
+ * 将 NOT IN 和 NOT EXISTS 转换为 left anti-join
+* 可选 join 重新排序
+ * 通过 `table.optimizer.join-reorder-enabled` 启用
-**Note:** IN/EXISTS/NOT IN/NOT EXISTS are currently only supported in
conjunctive conditions in subquery rewriting.
+**注释:** 当前仅在子查询重写的结合条件下支持 IN / EXISTS / NOT IN / NOT EXISTS。
-The optimizer makes intelligent decisions, based not only on the plan but also
rich statistics available from the data sources and fine-grain costs for each
operator such as io, cpu, network, and memory.
+优化器不仅基于计划,而且还基于可从数据源获得的丰富统计信息以及每个算子(例如 io,cpu,网络和内存)的细粒度成本来做出明智的决策。
-Advanced users may provide custom optimizations via a `CalciteConfig` object
that can be provided to the table environment by calling
`TableEnvironment#getConfig#setPlannerConfig`.
+高级用户可以通过 `CalciteConfig` 对象提供自定义优化,可以通过调用
`TableEnvironment#getConfig#setPlannerConfig` 将其提供给 TableEnvironment。
</div>
</div>
-### Explaining a Table
+### 解释表
-The Table API provides a mechanism to explain the logical and optimized query
plans to compute a `Table`.
-This is done through the `TableEnvironment.explain(table)` method or
`TableEnvironment.explain()` method. `explain(table)` returns the plan of a
given `Table`. `explain()` returns the result of a multiple-sinks plan and is
mainly used for the Blink planner. It returns a String describing three plans:
+Table API 提供了一种机制来解释计算`表`的逻辑和优化查询计划。
+这是通过 `TableEnvironment.explain(table)` 或者 `TableEnvironment.explain()`
完成的。`explain(table)` 返回给定`表`的计划。 `explain()` 返回多 sink 计划的结果并且主要用于 Blink
计划器。它返回一个描述三中计划的字符串:
Review comment:
三中计划 -> 三种计划
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services