Hi,
Yes, I can explain

1 to 3 -> 1,2,3
2 to 3- > 2,3
3 to 3 -> 3
3 to 3 -> 3

Flat map that concatenates the results, so you get

1,2,3, 2,3, 3,3

You should get the same with any scala collection

Cheers

From: Ashish Soni [mailto:asoni.le...@gmail.com]
Sent: Thursday, September 03, 2015 9:06 AM
To: user <user@spark.apache.org>
Subject: FlatMap Explanation

Hi ,
Can some one please explain the output of the flat map
data in RDD as below
{1, 2, 3, 3}

rdd.flatMap(x => x.to<http://x.to>(3))

output as below

{1, 2, 3, 2, 3, 3, 3}
i am not able to understand how the output came as above.
Thanks,

________________________________
This message is confidential and is for the sole use of the intended 
recipient(s). It may also be privileged or otherwise protected by copyright or 
other legal rules. If you have received it by mistake please let us know by 
reply email and delete it from your system. It is prohibited to copy this 
message or disclose its content to anyone. Any confidentiality or privilege is 
not waived or lost by any mistaken delivery or unauthorized disclosure of the 
message. All messages sent to and from Agoda may be monitored to ensure 
compliance with company policies, to protect the company's interests and to 
remove potential malware. Electronic messages may be intercepted, amended, lost 
or deleted, or contain viruses.

Reply via email to