scala - getting number of values within reduceByKey RDD -


When it's called Bike Operation, it's getting a list of the values ​​of a particular key. My question is Is that

  1. Is that the list of values ​​received in sequential order?
  2. Is it possible to know how much value he gets?
  3. I'm trying to calculate the quartile before the list of values ​​of a key, is it possible to reduce bark?

.1 No, it is against the whole situation of completely reducing the operation Going - that means taking advantage of co-operatives and commutitiates to parallel an operation in arbitrary tree of sub-operation.

.2. You will need to define a new monoide by typing an integer monoide and whatever you have to do is assume that your operation is op .

  yourRdd.map (kv = & gt; (kv._1, (kv._2, 1)). ReduceByKey ((left, right) => (left ._1 op Right ._1, left._2 + right ._2))  

You can get a RDD [(KiType, (ReducedValueType, Int))] where Int will be the number of values ​​received for each key.

.3. You have to be more specific about what you mean by quartiles first. Given that 1. There is no answer, you have to be bound by one that defines the first quartile, then you will not need data to sort because you can still filter the values ​​in spite of that.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -