-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"[Ljava.lang.String;@6479f067" etc is the way the JVM prints out raw
arrays. Note that String.split() returns an array of Strings. If you
want the result of split() to have a nicer String representation, try
turning those to, say, Lists with .toList .
On 10/04/2015 04:54 PM, Jimit Raithatha wrote:
> Hi All,
>
> Below is a small snippet i am working on that takes a list and
> splits it on character character "h".
>
> On purpose, I'm trying to return an RDD of lists in the below code
> because i want to explore differences between map() and flatMap().
> However, when i run the below code:
>
> valsentences = sc.parallelize(List("hello how","are you","doing
> sir")) val words = sentences.map(x=>x.split("h"))
> words.foreach(println)
>
>
> I get weird output as seen below:
>
> [Ljava.lang.String;@6479f067 [Ljava.lang.String;@1962dba
> [Ljava.lang.String;@2a940f26
>
> How do i print out the actual lists?
>
> Jimit
>
> -- You received this message because you are subscribed to the
> Google Groups "scala-user" group. To unsubscribe from this group
> and stop receiving emails from it, send an email to
>
scala-user+...@googlegroups.com
> <mailto:
scala-user+...@googlegroups.com>. For more options,
> visit
https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
iEYEARECAAYFAlYRyokACgkQ0GFaTS4nYxs/wACffbujBMD4rGcWNvtwVEBjC2jS
u+EAnjtJmOrf7b4Ii6FgdPFARta7WmNN
=dXaF
-----END PGP SIGNATURE-----