Re: Map from Tuple to Case Class

2016-05-04 Thread Stefano Baghino
I just noticed my snippets contains a whole lot of errors, but I'm glad it's been helpful. :) On Wed, May 4, 2016 at 3:59 PM, Robert Schmidtke wrote: > Thanks Stefano! I guess you're right, it's probably not too bad except the > MapFunction, which I have swapped with your suggestion now. I was j

Re: Map from Tuple to Case Class

2016-05-04 Thread Robert Schmidtke
Thanks Stefano! I guess you're right, it's probably not too bad except the MapFunction, which I have swapped with your suggestion now. I was just a bit confused by the fact that I had to state so many types, where I thought they could be inferred automatically. I tried variations of the "non-explic

Re: Map from Tuple to Case Class

2016-05-04 Thread Stefano Baghino
The only real noise I see is the usage of a MapFunction, which can be rewritten like this in Scala: case class Ranking(pageUrl: String, pageRank: Int, avgDuration: Int) val rankingsInput: DataSet[Ranking] = env.readHadoopFile(inputFormat, classOf[LongWritable], classOf[Text], rankingsInputPath,

Map from Tuple to Case Class

2016-05-04 Thread Robert Schmidtke
Hi everyone, first up, I'm new to Scala, so please bear with me, but I could not find any solution on the web or the Flink documentation. I'm having trouble converting a DataSet[(LongWritable, Text)] to a DataSet of a custom case class. I got it to work, however in a way that I feel is too verbose