YngwieWang commented on a change in pull request #9299: [FLINK-13405][docs-zh] 
Translate "Basic API Concepts" page into Chinese
URL: https://github.com/apache/flink/pull/9299#discussion_r317586108
 
 

 ##########
 File path: docs/dev/api_concepts.zh.md
 ##########
 @@ -315,55 +239,54 @@ val grouped = input.groupBy(0,1)
 </div>
 </div>
 
-Here, we group the tuples on a composite key consisting of the first and the
-second field.
+这里我们用第一个字段和第二个字段组成的组合键对 Tuple 分组
 
-A note on nested Tuples: If you have a DataStream with a nested tuple, such as:
+对于嵌套 Tuple 请注意: 如果你的 DataStream 是嵌套 Tuple,例如:
 
 {% highlight java %}
 DataStream<Tuple3<Tuple2<Integer, Float>,String,Long>> ds;
 {% endhighlight %}
 
-Specifying `keyBy(0)` will cause the system to use the full `Tuple2` as a key 
(with the Integer and Float being the key). If you want to "navigate" into the 
nested `Tuple2`, you have to use field expression keys which are explained 
below.
+指定 `keyBy(0)` 将导致系统使用整个 `Tuple2` 作为键(一个整数和一个浮点数)。 如果你想“进入”到 `Tuple2` 
的内部,你必须使用如下所述的字段表达式键。
 
-### Define keys using Field Expressions
+### 使用字段表达式定义键
 {:.no_toc}
 
-You can use String-based field expressions to reference nested fields and 
define keys for grouping, sorting, joining, or coGrouping.
+可以使用基于字符串的字段表达式来引用嵌套字段,并定义用于分组、排序、join 或 coGrouping 的键。
 
-Field expressions make it very easy to select fields in (nested) composite 
types such as [Tuple](#tuples-and-case-classes) and [POJO](#pojos) types.
+字段表达式可以很容易地选取复合(嵌套)类型中的字段,例如 [Tuple](#tuples-and-case-classes) 和 
[POJO](#pojos) 类型。
 
 <div class="codetabs" markdown="1">
 <div data-lang="java" markdown="1">
 
-In the example below, we have a `WC` POJO with two fields "word" and "count". 
To group by the field `word`, we just pass its name to the `keyBy()` function.
+下例中,我们有一个包含“word”和“count”两个字段的 POJO:`WC`。要用 `word` 字段分组,我们只需要把它的名字传给 `keyBy()` 
函数即可。
 {% highlight java %}
-// some ordinary POJO (Plain old Java Object)
+// 普通的 POJO(简单的 Java 对象)
 public class WC {
   public String word;
   public int count;
 }
 DataStream<WC> words = // [...]
-DataStream<WC> wordCounts = words.keyBy("word").window(/*window 
specification*/);
+DataStream<WC> wordCounts = words.keyBy("word").window(/*指定窗口*/);
 {% endhighlight %}
 
-**Field Expression Syntax**:
+**字段表达式语法**:
 
-- Select POJO fields by their field name. For example `"user"` refers to the 
"user" field of a POJO type.
+- 根据字段名称选择 POJO 的字段。例如 `“user”` 就是指 POJO 类型的“user”字段。
 
-- Select Tuple fields by their field name or 0-offset field index. For example 
`"f0"` and `"5"` refer to the first and sixth field of a Java Tuple type, 
respectively.
+- 根据字段名称或 0 开始的字段索引选择 Tuple 的字段。例如 `“f0”` 和 `“5”` 分别指 Java Tuple 类型的第一个和第五个字段。
 
 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

Reply via email to