[GitHub] flink pull request: [FLINK-2150] Added zipWithUniqueIds

2015-07-02 Thread vasia
Github user vasia commented on a diff in the pull request:

https://github.com/apache/flink/pull/801#discussion_r33820633
  
--- Diff: docs/apis/zip_elements_guide.md ---
@@ -63,4 +63,44 @@ env.execute()
 
 will yield the tuples: (0,A), (1,B), (2,C), (3,D), (4,E), (5,F)
 
+[Back to top](#top)
+
+### Zip with an Unique Identifier
+In many cases, one may not need to assign consecutive labels.
+`zipWIthUniqueId` works in a pipelined fashion, speeding up the label 
assignment process. This method receives a data set as input and returns a new 
data set of unique id, initial value tuples.
+For example, the following code:
+
+div class=codetabs markdown=1
+div data-lang=java markdown=1
+{% highlight java %}
+ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
+env.setParallelism(1);
+DataSetString in = env.fromElements(A, B, C, D, E, F);
+
+DataSetTuple2Long, String result = DataSetUtils.zipWithUniqueId(in);
+
+result.writeAsCsv(resultPath, \n, ,);
+env.execute();
+{% endhighlight %}
+/div
+
+div data-lang=scala markdown=1
+{% highlight scala %}
+import org.apache.flink.api.scala._
+
+val env: ExecutionEnvironment = 
ExecutionEnvironment.getExecutionEnvironment
+env.setParallelism(1)
+val input: DataSet[String] = env.fromElements(A, B, C, D, E, F)
+
+val result: DataSet[(Long, String)] = input.zipWithUniqueId
+
+result.writeAsCsv(resultPath, \n, ,)
+env.execute()
+{% endhighlight %}
+/div
+
+/div
+
+will yield the tuples: (0,A), (2,B), (4,C), (6,D), (8,E), (10,F)
--- End diff --

is the result deterministic?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2150] Added zipWithUniqueIds

2015-07-02 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/801#issuecomment-118171270
  
Merging...



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2150] Added zipWithUniqueIds

2015-07-02 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/801


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2150] Added zipWithUniqueIds

2015-06-30 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/801#issuecomment-117112526
  
Okay, can I get some +1s to merge this :)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2150] Added zipWithUniqueIds

2015-06-28 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/801#issuecomment-116287334
  
Hi @thvasilo ,

Sorry for the late reply... I stated in the `zipWithIndex` PR that I am 
waiting for that to be merged before I update this one :). So, here it is! 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---