Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 03-30-2016 12:55 AM
Hi,
what does the code do RDD.map(e => e.split(",")(1)) in spark with scala?
I know RDD.map(e => e.split(",")) would split a string with ',' separated. But, I don't get the (1) in the code. Could somebody give me some information on this? I would greatly appreciate your answer. Thanks!
Created 03-30-2016 01:32 AM
I'm not familiar with Scala but their docs are similar to Java so I would guess it would return the item at the first index of the result array.
Created 03-30-2016 01:32 AM
I'm not familiar with Scala but their docs are similar to Java so I would guess it would return the item at the first index of the result array.
Created 03-30-2016 01:46 AM
Hi Artem Ervits,
Thank you very much for your valuable time . I tried and it did exactly the same what you said. Once again Thanks!
Created 03-30-2016 03:26 AM
Glad to help, I learned something too about Scala, it was a mutual benefit