You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2018/12/13 04:06:10 UTC
[flink] 02/04: [hotfix] [docs] Improve DataSet.partitionCustom()
documentation.
This is an automated email from the ASF dual-hosted git repository.
fhueske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit c8dc83c3a6b62d95dbd1b1197a2c874208b1e0b6
Author: KarmaGYZ <ka...@gmail.com>
AuthorDate: Mon Dec 10 18:26:21 2018 +0800
[hotfix] [docs] Improve DataSet.partitionCustom() documentation.
This closes #7282.
---
docs/dev/batch/index.md | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/docs/dev/batch/index.md b/docs/dev/batch/index.md
index d004364..0a498df 100644
--- a/docs/dev/batch/index.md
+++ b/docs/dev/batch/index.md
@@ -401,12 +401,14 @@ DataSet<Integer> result = in.partitionByRange(0)
<tr>
<td><strong>Custom Partitioning</strong></td>
<td>
- <p>Manually specify a partitioning over the data.
+ <p>Assigns records based on a key to a specific partition using a custom Partitioner function.
+ The key can be specified as position key, expression key, and key selector function.
<br/>
- <i>Note</i>: This method works only on single field keys.</p>
+ <i>Note</i>: This method only works with a single field key.</p>
{% highlight java %}
DataSet<Tuple2<String,Integer>> in = // [...]
-DataSet<Integer> result = in.partitionCustom(Partitioner<K> partitioner, key)
+DataSet<Integer> result = in.partitionCustom(partitioner, key)
+ .mapPartition(new PartitionMapper());
{% endhighlight %}
</td>
</tr>
@@ -703,13 +705,14 @@ val result = in.partitionByRange(0).mapPartition { ... }
<tr>
<td><strong>Custom Partitioning</strong></td>
<td>
- <p>Manually specify a partitioning over the data.
+ <p>Assigns records based on a key to a specific partition using a custom Partitioner function.
+ The key can be specified as position key, expression key, and key selector function.
<br/>
- <i>Note</i>: This method works only on single field keys.</p>
+ <i>Note</i>: This method only works with a single field key.</p>
{% highlight scala %}
val in: DataSet[(Int, String)] = // [...]
val result = in
- .partitionCustom(partitioner: Partitioner[K], key)
+ .partitionCustom(partitioner, key).mapPartition { ... }
{% endhighlight %}
</td>
</tr>