[
https://issues.apache.org/jira/browse/BEAM-6386?focusedWorklogId=187006&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-187006
]
ASF GitHub Bot logged work on BEAM-6386:
----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Jan/19 19:27
Start Date: 18/Jan/19 19:27
Worklog Time Spent: 10m
Work Description: swegner commented on pull request #7437: [BEAM-6386]
Add named variant of PTransform::compose()
URL: https://github.com/apache/beam/pull/7437#discussion_r249159679
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PTransform.java
##########
@@ -319,4 +319,16 @@ public OutputT expand(InputT input) {
}
};
}
+
+ /** Like {@link #compose(SerializableFunction)}, but with a custom name. */
+ @Experimental
+ public static <InputT extends PInput, OutputT extends POutput>
Review comment:
What's the use-case for naming this "anonymous" composite?
My understanding is that this syntax is a shorthand for defining one-off
composites inline in the pipeline definition. In that case, is it sufficient to
name the transform application?
```java
PCollection<Input> input = // ..
input.apply("named application", PTransform.compose((PCollectionTuple input)
-> { /* .. */ });
```
In general, it's best to keep the user API as simple as possible. Extra API
surface area adds maintenance cost. So we should only add new APIs when there
is clear value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 187006)
Time Spent: 20m (was: 10m)
> Add named variant of PTransform::compose
> ----------------------------------------
>
> Key: BEAM-6386
> URL: https://issues.apache.org/jira/browse/BEAM-6386
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Jeff Klukas
> Assignee: Jeff Klukas
> Priority: Minor
> Time Spent: 20m
> Remaining Estimate: 0h
>
> BEAM- 5413 introduced PTransform::compose as a concise way of creating a
> composition of transforms as a lambda. We should add a variant to allow
> specifying a name for the returned transform in the same way that {{apply}}
> can take an explicit name.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)