[jira] [Created] (FLINK-1098) flatArray() operator that converts arrays to elements

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-1098) flatArray() operator that converts arrays to elements

Shang Yuanchun (Jira)
Timo Walther created FLINK-1098:
-----------------------------------

             Summary: flatArray() operator that converts arrays to elements
                 Key: FLINK-1098
                 URL: https://issues.apache.org/jira/browse/FLINK-1098
             Project: Flink
          Issue Type: New Feature
            Reporter: Timo Walther
            Priority: Minor


It would be great to have an operator that converts e.g. from String[] to String. Actually, it is just a flatMap over the elements of an array.

A typical use case is a WordCount where we then could write:

{code}
text
.map((line) -> line.toLowerCase().split("\\W+"))
.flatArray()
.map((word) -> new Tuple2(word, 1))
.groupBy(0)
.sum(1);
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)