flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nsengupta <sengupta.nirma...@gmail.com>
Subject Re: Count of Grouped DataSet
Date Mon, 02 May 2016 17:57:44 GMT
Hello Fabian,

Thanks for taking time to provide your recommendation, This is how I have

case class Something(f1: Int,f2: Int,f3: Int,f4: String ) // My
application's data structure

    *val k = envDefault
      .map(e => (e.f1, e.f2, e.f3, e.f4,1))  // I create a temporary tuple
      .map(e => (Something(e._1,e._2,e._3,e._4),e._5))

The output is 

I need to create a temporary tuple, because I need group by fields of the
case class; yet, I need to sum the fifth (newly added) field. Somehow, I
feel this is clunky! 

Is this a preferred way? Is there a better (performant, yet idiomatic) way?
Please make me wiser.

-- Nirmalya

View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Count-of-Grouped-DataSet-tp6592p6623.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

View raw message