spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Pfeiffer <>
Subject Re: convert List<String> to dstream
Date Tue, 11 Nov 2014 01:05:20 GMT

On Tue, Nov 11, 2014 at 7:43 AM, Josh J <> wrote:
> I have some data generated by some utilities that returns the results as
> a List<String>. I would like to join this with a Dstream of strings. How
> can I do this? I tried the following though get scala compiler errors
> val list_scalaconverted =
> ssc.sparkContext.parallelize(listvalues.toArray())

Your `listvalues` seems to be a java.util.List, not a
scala.collection.immutable.List, right? In that case, toArray() will return
a Array[Object], not an Array[String], which leads to the error you see.
Have a look at$
and convert your Java list to a Scala list.


View raw message