Output of KeyBy->TimeWindow->Reduce?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Output of KeyBy->TimeWindow->Reduce?

Jon Yeargers
Take the above topology and send the resultant DataStream to .print(). 

Assume the Reduce function changes a character to it's uppercase equivalent.

Assume this whole stream makes it within the span of a single Window.

Send it a stream like a,b,c,d,e,f,g,h,c,e,g.  


What will be output?

a) a,b,C,d,E,f,G,h
b) a,b,c,d,e,f,g,h
c) a,b,c,c,d,e,e,f,g,g,h
d) something else


Reply | Threaded
Open this post in threaded view
|

Re: Output of KeyBy->TimeWindow->Reduce?

Aljoscha Krettek
Hi,
what does the reduce function do exactly? Something like this?

(a: String, b: String) -> b.toUppercase

If yes, then I would expect a) to be the output you get.

if it is this:

(a: String, b: String) -> a + b.toUppercase

then I would expect this: a,b,cC,d,eE,f,gG,h

Cheers,
Aljoscha

On Sun, 7 Aug 2016 at 17:28 Jon Yeargers <[hidden email]> wrote:
Take the above topology and send the resultant DataStream to .print(). 

Assume the Reduce function changes a character to it's uppercase equivalent.

Assume this whole stream makes it within the span of a single Window.

Send it a stream like a,b,c,d,e,f,g,h,c,e,g.  


What will be output?

a) a,b,C,d,E,f,G,h
b) a,b,c,d,e,f,g,h
c) a,b,c,c,d,e,e,f,g,g,h
d) something else