[
https://issues.apache.org/jira/browse/BEAM-9616?focusedWorklogId=491510&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-491510
]
ASF GitHub Bot logged work on BEAM-9616:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Sep/20 03:20
Start Date: 26/Sep/20 03:20
Worklog Time Spent: 10m
Work Description: lostluck commented on pull request #12903:
URL: https://github.com/apache/beam/pull/12903#issuecomment-699292528
Heh no worries.
On Fri, Sep 25, 2020, 8:18 PM Daniel Oliveira <[email protected]>
wrote:
> *@youngoli* commented on this pull request.
> ------------------------------
>
> In sdks/go/pkg/beam/core/runtime/genx/genx.go
> <https://github.com/apache/beam/pull/12903#discussion_r495407788>:
>
> > + for _, t := range ts {
> + runtime.RegisterType(t)
> + }
> +}
> +
> +// registerDoFn returns all types associated with the provided DoFn.
> +// If passed a functional DoFn, the first return is a Function to
> +// register with runtime.RegisterFunction.
> +// The second return is all types to register with runtime.RegisterType.
> +// Returns an error if the passed in values are not DoFns.
> +func registerDoFn(dofn interface{}) (interface{}, []reflect.Type, error) {
> + if rt, ok := dofn.(reflect.Type); ok {
> + if rt.Kind() == reflect.Ptr {
> + rt = rt.Elem()
> + }
> + dofn = reflect.New(rt).Interface()
>
> Oh, duh. I had a brain-fart that this statement only happens if the dofn
> is a reflect.Type. I was imagining turning an actual DoFn instance into a
> reflect.Type and back. Makes complete sense now.
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/beam/pull/12903#discussion_r495407788>, or
> unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/ADKDOFOLZ77ACW4VD36USQTSHVMPHANCNFSM4RV745WQ>
> .
>
----------------------------------------------------------------
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: 491510)
Time Spent: 2h 40m (was: 2.5h)
> [Go SDK] starcgen improvements
> ------------------------------
>
> Key: BEAM-9616
> URL: https://issues.apache.org/jira/browse/BEAM-9616
> Project: Beam
> Issue Type: Improvement
> Components: sdk-go
> Reporter: Robert Burke
> Assignee: Robert Burke
> Priority: P3
> Labels: golang
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> The starcgen code generator works OK, but could do with some improvements.
> * Uniquifying imports (handling multiple imports with same short suffix)
> * Generating multiple iterNatives (eg when the normal symbol is already
> taken).
> * Keying off of beam.Register* calls rather than command line.
> ** Avoids duplicating lists of identifiers, and improves default behavior.
> ** Possibly have a new beam.RegisterDoFn which can take a list of DoFn and
> struct types a function or a struct, and key off those, reducing boiler plate
> somewhat.
> * Perhaps having a specific single import alias package for components
> required for import, rather than the current 3-4.
> * Generate efficient Beam Schema coders for registered types?
> * Handle SplittableDoFns properly.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)