You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
source.flatMapValues(value-> Arrays.asList(pattern.split(value.toLowerCase()))).map((key, value) -> new KeyValue<Object, Object>(value, value))
In fact, the map is confusing because it expect a pair. value-> Arrays.asList(pattern.split(value.toLowerCase()))). is supposed to return a list of word not list pair. Hence i do not understand the chaining here.
Please can you explain that ?
The text was updated successfully, but these errors were encountered:
I'm converting it to a list. Flatmap takes the stream of lists (or any other iterable), flattens it into a stream of events and applies the mapping (turning each (key, value) into (value,value)).
Hi,
I do not understand that line:
source.flatMapValues(value-> Arrays.asList(pattern.split(value.toLowerCase()))).map((key, value) -> new KeyValue<Object, Object>(value, value))
In fact, the map is confusing because it expect a pair. value-> Arrays.asList(pattern.split(value.toLowerCase()))). is supposed to return a list of word not list pair. Hence i do not understand the chaining here.
Please can you explain that ?
The text was updated successfully, but these errors were encountered: