Re: Substract two DStreams

2016-06-28 Thread Marius Soutier
Sure, no problem.

> On 28.06.2016, at 08:57, Matthias Niehoff  
> wrote:
> 
> ah, didn't know about this. That might actually work. I solved it by 
> implementing the leftJoinWithCassandraTable by myself which is nearly as fast 
> as the normal join. This should be faster than joining and subtracting then. 
> Anyway, thanks for the hint of the transformWith method!
> 
> Am 27. Juni 2016 um 14:32 schrieb Marius Soutier  >:
> `transformWith` accepts another stream, wouldn't that work?
> 
>> On 27.06.2016, at 14:04, Matthias Niehoff > > wrote:
>> 
>> in transform I have only access to one stream and not do both the original 
>> and the change stream. in foreachRDD i can change the stream and have both 
>> the original RDD and the changed RDD to do a substract.
>> 
>> 2016-06-27 13:13 GMT+02:00 Marius Soutier > >:
>> Can't you use `transform` instead of `foreachRDD`?
>> 
>> 
>> 
>>> On 15.06.2016, at 15:18, Matthias Niehoff >> > wrote:
>>> 
>>> Hi,
>>> 
>>> i want to subtract 2 DStreams (based on the same Input Stream) to get all 
>>> elements that exist in the original stream, but not in the modified stream 
>>> (the modified Stream is changed using joinWithCassandraTable which does an 
>>> inner join and because of this might remove entries).
>>> 
>>> Subtract is only possible on RDDs. So I could use a foreachRDD right in the 
>>> beginning of the Stream processing and work on rdds. I think its quite ugly 
>>> to use the output op at the beginning and then implement a lot of 
>>> transformations in the foreachRDD. So could you think of different ways to 
>>> do an efficient diff between to DStreams?
>>> 
>>> Thank you
>>> 
>>> -- 
>>> Matthias Niehoff | IT-Consultant | Agile Software Factory  | Consulting
>>> codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland
>>> tel: +49 (0) 721.9595-681  | fax: +49 
>>> (0) 721.9595-666  | mobil: +49 (0) 
>>> 172.1702676 
>>> www.codecentric.de  | blog.codecentric.de 
>>>  | www.meettheexperts.de 
>>>  | www.more4fi.de  
>>> 
>>> Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal
>>> Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
>>> Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz
>>> 
>>> Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche 
>>> und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige 
>>> Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie 
>>> bitte sofort den Absender und löschen Sie diese E-Mail und evtl. 
>>> beigefügter Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen 
>>> evtl. beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist 
>>> nicht gestattet
>> 
>> 
>> 
>> 
>> -- 
>> Matthias Niehoff | IT-Consultant | Agile Software Factory  | Consulting
>> codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland
>> tel: +49 (0) 721.9595-681  | fax: +49 
>> (0) 721.9595-666  | mobil: +49 (0) 
>> 172.1702676 
>> www.codecentric.de  | blog.codecentric.de 
>>  | www.meettheexperts.de 
>>  | www.more4fi.de  
>> 
>> Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal
>> Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
>> Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz
>> 
>> Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche 
>> und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige 
>> Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie 
>> bitte sofort den Absender und löschen Sie diese E-Mail und evtl. beigefügter 
>> Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. 
>> beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht 
>> gestattet
> 
> 
> 
> 
> -- 
> Matthias Niehoff | IT-Consultant | Agile Software Factory  | Consulting
> codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland
> tel: +49 (0) 721.9595-681  | fax: +49 (0) 
> 721.9595-666  | mobil: +49 (0) 
> 172.1702676 
> www.codecentric.de  | blog.codecentric.de 
>  | www.meettheexperts.de 
> 

Re: Substract two DStreams

2016-06-27 Thread Marius Soutier
Can't you use `transform` instead of `foreachRDD`?


> On 15.06.2016, at 15:18, Matthias Niehoff  
> wrote:
> 
> Hi,
> 
> i want to subtract 2 DStreams (based on the same Input Stream) to get all 
> elements that exist in the original stream, but not in the modified stream 
> (the modified Stream is changed using joinWithCassandraTable which does an 
> inner join and because of this might remove entries).
> 
> Subtract is only possible on RDDs. So I could use a foreachRDD right in the 
> beginning of the Stream processing and work on rdds. I think its quite ugly 
> to use the output op at the beginning and then implement a lot of 
> transformations in the foreachRDD. So could you think of different ways to do 
> an efficient diff between to DStreams?
> 
> Thank you
> 
> -- 
> Matthias Niehoff | IT-Consultant | Agile Software Factory  | Consulting
> codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland
> tel: +49 (0) 721.9595-681  | fax: +49 (0) 
> 721.9595-666  | mobil: +49 (0) 
> 172.1702676 
> www.codecentric.de  | blog.codecentric.de 
>  | www.meettheexperts.de 
>  | www.more4fi.de  
> 
> Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal
> Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
> Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz
> 
> Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche 
> und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige 
> Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie 
> bitte sofort den Absender und löschen Sie diese E-Mail und evtl. beigefügter 
> Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. 
> beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht 
> gestattet