You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Kenneth Knowles (JIRA)" <ji...@apache.org> on 2016/09/21 15:41:20 UTC

[jira] [Updated] (BEAM-656) Add support for side inputs/outputs to Java 8 lambdas in MapElements

     [ https://issues.apache.org/jira/browse/BEAM-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenneth Knowles updated BEAM-656:
---------------------------------
    Description: 
Currently there's no way to use side inputs or outputs within Java 8 lambdas and MapElements.  It would be nice if you could do something like this:

{code:java}
PCollection<Integer> wordLengths = words.apply(
    MapElements.via((String word) -> {
      int sideInput1= [[[ GetSideInputHere(); ]]]
      [[[ SetSideOutputHere ]]] (sideInput1+word.length());
      return word.length();
    }).withOutputType(new TypeDescriptor<Integer>() {});
{code}

  was:
Currently there's no way to use side inputs or outputs within Java 8 lambdas and MapElements.  It would be nice if you could do something like this:

PCollection<Integer> wordLengths = words.apply(
MapElements.via((String word) -> {
int sideInput1= [[[ GetSideInputHere(); ]]]
[[[ SetSideOutputHere ]]] (sideInput1+word.length());
return word.length();
}).withOutputType(new TypeDescriptor<Integer>() {});



> Add support for side inputs/outputs to Java 8 lambdas in MapElements
> --------------------------------------------------------------------
>
>                 Key: BEAM-656
>                 URL: https://issues.apache.org/jira/browse/BEAM-656
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-ideas
>         Environment: Java 8
>            Reporter: Jani Patokallio
>            Assignee: James Malone
>            Priority: Minor
>
> Currently there's no way to use side inputs or outputs within Java 8 lambdas and MapElements.  It would be nice if you could do something like this:
> {code:java}
> PCollection<Integer> wordLengths = words.apply(
>     MapElements.via((String word) -> {
>       int sideInput1= [[[ GetSideInputHere(); ]]]
>       [[[ SetSideOutputHere ]]] (sideInput1+word.length());
>       return word.length();
>     }).withOutputType(new TypeDescriptor<Integer>() {});
> {code}



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