[ https://issues.apache.org/jira/browse/BEAM-6386?focusedWorklogId=188490&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-188490 ]
ASF GitHub Bot logged work on BEAM-6386: ---------------------------------------- Author: ASF GitHub Bot Created on: 22/Jan/19 21:31 Start Date: 22/Jan/19 21:31 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_r249967618 ########## 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: First off-- thanks for taking the time to write up the motivation. I believe I have a good understanding of the scenario now. So, have two ways of specifying a composite transform: 1. By defining a class which extends `PTransform<TIn, TOut>` and filling in the `expand()` method. 2. Using this `PTranform.compose()` helper syntax. Defining a class gives access to all features of the PTransform spec (naming, validation, display data, multiple inputs), while the helper syntax offers a very concise syntax for the simplest cases. My general thoughts: a. We shouldn't add verbosity to the shorthand syntax as it removes the utility of it. b. We shouldn't add a bunch of complexity to the shorthand but and instead defer to the full syntax. In this case, having an overload with a String name is still a useful shorthand and doesn't violate either of the above. And you've defined a real scenario where it provides value. So: I'm convinced. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 188490) Time Spent: 50m (was: 40m) > 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: 50m > 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)