[
https://issues.apache.org/jira/browse/BEAM-12639?focusedWorklogId=625770&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-625770
]
ASF GitHub Bot logged work on BEAM-12639:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jul/21 19:50
Start Date: 20/Jul/21 19:50
Worklog Time Spent: 10m
Work Description: lukecwik commented on a change in pull request #15191:
URL: https://github.com/apache/beam/pull/15191#discussion_r673433028
##########
File path: sdks/go/pkg/beam/core/runtime/exec/sdf_invokers_test.go
##########
@@ -382,3 +382,50 @@ func (fn *VetKvSdf) ProcessElement(rt *VetRTracker, i, j
int, emit func(*VetRest
rest.ProcessElm = true
emit(rest)
}
+
+// VetEmptyInitialSplitSdf runs an SDF in order to test that these methods get
called properly,
+// each method will flip the corresponding flag in the passed in
VetRestriction,
+// overwrite the restriction's Key and Val with the last seen input elements,
+// and retain the other fields in the VetRestriction.
+type VetEmptyInitialSplitSdf struct {
Review comment:
That looks so convenient but was unable to get it to work since the
ProcessElement method was not being found.
Code I used was:
```
// VetEmptyInitialSplitSdf runs an SDF in order to test that these methods
get called properly,
// each method will flip the corresponding flag in the passed in
VetRestriction,
// overwrite the restriction's Key and Val with the last seen input elements,
// and retain the other fields in the VetRestriction.
type VetEmptyInitialSplitSdf struct {
sdf *VetSdf `default:"{}"`
}
// SplitRestriction outputs zero restrictions.
func (fn *VetEmptyInitialSplitSdf) SplitRestriction(i int, rest
*VetRestriction) []*VetRestriction {
return []*VetRestriction{}
}
```
Error I got was:
```
=== RUN TestSdfNodes
--- FAIL: TestSdfNodes (0.00s)
sdf_test.go:62: invalid function: graph.AsDoFn: for Fn named
github.com/apache/beam/sdks/go/pkg/beam/core/runtime/exec.VetEmptyInitialSplitSdf
failed to find ProcessElement method
```
Will merge as-is. Using the type embedding seems very convenient to have.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 625770)
Time Spent: 1h 20m (was: 1h 10m)
> Go SDK SplitAndSizeRestrictions should allow for an empty split
> ---------------------------------------------------------------
>
> Key: BEAM-12639
> URL: https://issues.apache.org/jira/browse/BEAM-12639
> Project: Beam
> Issue Type: Bug
> Components: sdk-go
> Reporter: Luke Cwik
> Assignee: Luke Cwik
> Priority: P2
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> https://github.com/apache/beam/blob/d99ebb69f7adc0afe1ffc607d1bbdda80eb2e08a/sdks/go/pkg/beam/core/runtime/exec/sdf.go#L175
> currently validates that there is at least one split.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)