[
https://issues.apache.org/jira/browse/BEAM-11106?focusedWorklogId=762967&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-762967
]
ASF GitHub Bot logged work on BEAM-11106:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Apr/22 15:24
Start Date: 27/Apr/22 15:24
Worklog Time Spent: 10m
Work Description: damccorm commented on code in PR #17432:
URL: https://github.com/apache/beam/pull/17432#discussion_r859936695
##########
sdks/go/pkg/beam/core/graph/fn.go:
##########
@@ -847,9 +886,15 @@ func validateSdfSigNumbers(fn *Fn, num int) error {
func validateSdfSigTypes(fn *Fn, num int) error {
restrictionT := fn.methods[createInitialRestrictionName].Ret[0].T
rTrackerT := reflect.TypeOf((*sdf.RTracker)(nil)).Elem()
-
- for _, name := range requiredSdfNames {
- method := fn.methods[name]
+ bRTrackerT := fn.methods[createTrackerName].Ret[0].T
+ optionalSdfs := optionalSdfNameMap()
+
+ for _, name := range sdfNames {
+ method, ok := fn.methods[name]
+ if !ok && optionalSdfs[name] {
+ // skip validating unimplemented optional sdf methodsß
+ continue
+ }
Review Comment:
Ah, I missed that this would throw if the method is unimplemented before
your changes - I understand why you're doing this now.
With that said, I think it might be cleaner to move the optional sdfs into
their own switch statement rather than doing this kind of filtering. That also
lets us keep it so that this function will throw if a required sdf name isn't
present (I think other validation does check that, so its probably not a big
deal either way). That would let you get rid of this map entirely and you
wouldn't have to do any special filtering.
I'll leave that as an optional suggestion
Issue Time Tracking
-------------------
Worklog Id: (was: 762967)
Time Spent: 2h 40m (was: 2.5h)
> [Go SDK] Truncating SDFs during drain
> -------------------------------------
>
> Key: BEAM-11106
> URL: https://issues.apache.org/jira/browse/BEAM-11106
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Robert Burke
> Assignee: Ritesh Ghorse
> Priority: P3
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> Allow SDFs to specify a restriction truncation method to permit faster drains.
> (To be updated once [https://github.com/apache/beam/pull/13160] is merged and
> the programming guide updated with SDF content.)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)