spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Franco Barrientos" <franco.barrien...@exalitica.com>
Subject Map inside map
Date Wed, 26 Nov 2014 18:36:12 GMT
Hi all!,

 

I want to make a map insede another map, for example:

 

val tablon_perc=tablon_resp.map{p=>

val dato=(p(3).toString).toInt

val
perc=tablon_resp.map(l=>if((l(3).toString).toInt<=dato){(1)}else{(0)}).sum()

(dato,perc)

}

 

Where tablon_resp is a SchemaRDD. My idea is to calculate in perc variable
the number of observations les sor equal to each elements of tablón_resp,
but I get this error:

 



 

Is posible to make a map into another map function? Or an optional way to do
this?

 

Thx,

 

Franco Barrientos
Data Scientist

Málaga #115, Of. 1003, Las Condes.
Santiago, Chile.
(+562)-29699649
(+569)-76347893

 <mailto:franco.barrientos@exalitica.com> franco.barrientos@exalitica.com 

 <http://www.exalitica.com/> www.exalitica.com


  <http://exalitica.com/web/img/frim.png> 

 


Mime
View raw message