[
https://issues.apache.org/jira/browse/BEAM-7157?focusedWorklogId=234365&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-234365
]
ASF GitHub Bot logged work on BEAM-7157:
----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Apr/19 07:57
Start Date: 29/Apr/19 07:57
Worklog Time Spent: 10m
Work Description: robertwb commented on pull request #8409: [BEAM-7157]
Allow creation of BinaryCombineFn from lambdas.
URL: https://github.com/apache/beam/pull/8409#discussion_r279264315
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
##########
@@ -435,6 +488,27 @@ public OutputT defaultValue() {
*/
public abstract static class BinaryCombineFn<V> extends CombineFn<V,
Holder<V>, V> {
+ /**
+ * Returns a {@code CombineFn} that uses the given {@code
SerializableBiFunction} to combine
+ * values.
+ */
+ public static <V> BinaryCombineFn<V> of(SerializableBiFunction<V, V, V>
combiner) {
+ return new BinaryCombineFn<V>() {
+ @Override
+ public V apply(V left, V right) {
+ return combiner.apply(left, right);
+ }
+ };
+ }
+
+ public static BinaryCombineFn<Long> foo() {
Review comment:
Oh, yes, I was validating what inference could and could not accept. It's
now in the test file but I forgot to delete it here. Thanks.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 234365)
Time Spent: 1h 20m (was: 1h 10m)
> Allow creation of BinaryCombineFn from lambdas.
> -----------------------------------------------
>
> Key: BEAM-7157
> URL: https://issues.apache.org/jira/browse/BEAM-7157
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Robert Bradshaw
> Priority: Major
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)