spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <>
Subject I want to filter a stream by a subclass.
Date Wed, 21 May 2014 22:28:30 GMT
Firstly I'm a newb (to both Scala & Spark).

I have a stream, that contains multiple types of records, and I would like
to create multiple streams based on that

currently I have it set up as

class ALL
class Orange extends ALL
class Apple extends ALL

now I can easily add a filter ala
val records:DStream[ALL] = ...mapper to build the classes off the wire...
val orangeRecords = records.filter {_.isInstanceOf[Orange]}

but I would like to have the line be a DStream[Orange] instead of a
(So I can access the unique fields in the subclass).

I'm using 0.9.1 if it matters.


Ian Holsman
PH: + 61-3-9028 8133 / +1-(425) 998-7083

View raw message