-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-2152] Added zipWithIndex #832
Conversation
+1 to merge. |
public class DataSetUtils<T> { | ||
|
||
/** | ||
* Method that goes over all the elements in each partition in order to retireve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retrieve
Good work @andralungu. The data set utils are not working with the Scala API. Would be nice to support for Scala a syntax like
|
env.setParallelism(1); | ||
DataSet<String> in = env.fromElements("A", "B", "C", "D", "E", "F"); | ||
|
||
DataSetUtils<String> dataSetUtils = new DataSetUtils<String>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to create a DataSetUtils
object here? So far it does not store any state.
Sorry for my late reply. Has everything worked out by now? On Tue, Jun 23, 2015 at 2:43 PM, Andra Lungu notifications@github.com
|
Actually, I get a weird compile error: it says missing Type parameter for the map in DataSet.scala... |
Is it a type inference problem? Have you tried importing org.apache.flink.api.scala._ to see if that fixes it? |
Uhmmm... flink.api.scala is imported. That's not the issue. |
Seems like the problem was that the wrap was returning a DataSet[(java.lang.Long, T)] If you change the map to |
Hey Theo, Thanks a lot for finding my bug there ^^ |
|
||
@Rule | ||
def getFolder(): TemporaryFolder = { | ||
tempFolder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon :) You can simplify this method as def getFolder = tempFolder
.
Hi, I added some minor comments about coding style in Scala test case. The rest things is okay. |
[FLINK-2152] Added zipWithIndex utility method [FLINK-2152] Fixed minor documentation bug
[FLINK-2152] Scala zipWithIndex; second attempt [FLINK-2152] Scala zipWithIndex - finalised [FLINK-2152] Fixed checkstyle violation
Perfectly valid comments, thanks! PR Updated. |
Looks good :) merging |
Oops! I forgot add "This closes #832" into commit message. I mistook because this is my first commit to upload Apache repository. Sorry. How can I fix it? |
No problem ;) |
This PR adds the zipWithIndex utility method to Flink's DataSetUtils as described in the mailing list discussion: http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/The-correct-location-for-zipWithIndex-and-zipWithUniqueId-td6310.html.
The method could, in the future, be moved to DataSet.
@fhueske , @tillrohrmann , once we reach a conclusion for this one, I will also update #801 (I wouldn't like to fix unnecessary merge conflicts).
Once zipWIthUniqueIds is added, I could also explain the difference in the docs.