The following will achieve what you have asked for: sc.parallelize(1 to 3).cartesian(rdd)
------------------------------------------------------------------------------- Robin East Spark GraphX in Action Michael Malak and Robin East Manning Publications Co. http://www.manning.com/books/spark-graphx-in-action <http://www.manning.com/books/spark-graphx-in-action> > On 8 Oct 2016, at 12:19, anupama [via Apache Spark User List] > <ml-node+s1001560n27868...@n3.nabble.com> wrote: > > I have an rdd > > ( 0,[1,2,3]) > > I want the output like this > > 1,( 0,[1,2,3]) > 2, ( 0,[1,2,3]) > 3, ( 0,[1,2,3]) > > please help > > If you reply to this email, your message will be added to the discussion > below: > http://apache-spark-user-list.1001560.n3.nabble.com/working-with-multiple-values-tp27271p27868.html > > <http://apache-spark-user-list.1001560.n3.nabble.com/working-with-multiple-values-tp27271p27868.html> > To start a new topic under Apache Spark User List, email > ml-node+s1001560n1...@n3.nabble.com > To unsubscribe from Apache Spark User List, click here > <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=Um9iaW4uZWFzdEB4ZW5zZS5jby51a3wxfDIzMzQzMDUyNg==>. > NAML > <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> ----- Robin East Spark GraphX in Action Michael Malak and Robin East Manning Publications Co. http://www.manning.com/books/spark-graphx-in-action -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/working-with-multiple-values-tp27271p27869.html Sent from the Apache Spark User List mailing list archive at Nabble.com.