pabloem commented on PR #22134:
URL: https://github.com/apache/beam/pull/22134#issuecomment-1180776341

   I thought of something like this:
   
   ```
   chainedPromises = lines
     .map((s: string) => s.toLowerCase())
     .flatMap(function* splitWords(line: string) {
           yield* line.split(/[^a-z]+/);
         })
       .apply(beam.countPerElement());
   
   countPcoll = chainedPromises.resolve();
   
   // In case of error while expanding an intermediate PCollection, then we can 
throw/return an error from there when resolving the PCollection
   // (error e.g. to resolve schema, or to match input/output types / etc).
   ```
   
   Where each `apply(...)` returns a `Promise<PCollection<...>>` and the actual 
expansion is deferred... 
   
   though I haven't researched JS enough, I think this is doable...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to