[
https://issues.apache.org/jira/browse/BEAM-11019?focusedWorklogId=496251&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-496251
]
ASF GitHub Bot logged work on BEAM-11019:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Oct/20 00:45
Start Date: 07/Oct/20 00:45
Worklog Time Spent: 10m
Work Description: youngoli commented on a change in pull request #13013:
URL: https://github.com/apache/beam/pull/13013#discussion_r500674070
##########
File path: sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
##########
@@ -400,6 +400,90 @@ func TestAsSplittableUnit(t *testing.T) {
if err != nil {
t.Fatalf("invalid function: %v", err)
}
+ //wdfn, err := graph.NewDoFn(&VetWindowSdf{},
graph.NumMainInputs(graph.MainSingle))
+ //if err != nil {
+ // t.Fatalf("invalid function: %v", err)
+ //}
+ multiWindows := []typex.Window{
+ window.IntervalWindow{Start: 10, End: 20},
+ window.IntervalWindow{Start: 11, End: 21},
+ window.IntervalWindow{Start: 12, End: 22},
+ window.IntervalWindow{Start: 13, End: 23},
+ }
+
+ // Test that progress returns expected results and respects windows.
+ t.Run("Progress", func(t *testing.T) {
+ tests := []struct {
+ name string
+ fn *graph.DoFn
+ in FullValue
+ doneWork float64 // Will be output by RTracker's
GetProgress.
+ remainingWork float64 // Will be output by RTracker's
GetProgress.
+ currWindow int
+ wantProgress float64
+ }{
+ {
+ name: "SingleWindow",
+ fn: dfn,
+ in: FullValue{
+ Elm: &FullValue{
+ Elm: 1,
+ Elm2: &VetRestriction{ID:
"Sdf"},
+ },
+ Elm2: 1.0,
+ Timestamp: testTimestamp,
+ Windows: testWindows,
+ },
+ doneWork: 1.0,
+ remainingWork: 1.0,
+ currWindow: 0,
+ wantProgress: 0.5,
+ },
+ {
+ name: "MultipleWindows",
+ fn: dfn,
Review comment:
This test doesn't actually check the code in ProcessElement because it
never actually calls ProcessElement, so it doesn't actually matter what the
DoFn being used is (in fact, I can probably erase that field from the tests).
It's unit testing the SplittableUnit behavior specifically.
I think I can add a unit test to make sure ProcessElement handles windows
correctly (or a component test technically, since it's testing multiple
methods), but it's a little more involved since I need to figure out how to
block processing to check progress and perform splits. I'll add it in the
upcoming PR enabling multi-window splitting.
----------------------------------------------------------------
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: 496251)
Time Spent: 1h 10m (was: 1h)
> Adjust Go SDF progress reporting to account for multi-window elements.
> ----------------------------------------------------------------------
>
> Key: BEAM-11019
> URL: https://issues.apache.org/jira/browse/BEAM-11019
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Daniel Oliveira
> Assignee: Daniel Oliveira
> Priority: P2
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> SDF progress reporting should account for exploded windows. For example, if
> an element being processed is in three windows, and those windows get
> exploded, then it essentially is being processed 3 times. So after the first
> window's done, progress should be at 1/3, then at 2/3 after the second, and
> so on. Instead, at the moment progress is only reported for the current
> element which means it'll constantly loop from 0 -> 1.0 over and over as the
> element gets processed in each window.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)