[ 
https://issues.apache.org/jira/browse/BEAM-5354?focusedWorklogId=250315&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-250315
 ]

ASF GitHub Bot logged work on BEAM-5354:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/19 17:36
            Start Date: 29/May/19 17:36
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on pull request #8713: [BEAM-5354] 
Add side input nodes to their consumer's parent-scope.
URL: https://github.com/apache/beam/pull/8713#discussion_r288686466
 
 

 ##########
 File path: sdks/go/pkg/beam/core/runtime/graphx/translate.go
 ##########
 @@ -128,7 +128,7 @@ func (m *marshaller) addScopeTree(s *ScopeTree) string {
 
        var subtransforms []string
        for _, edge := range s.Edges {
-               subtransforms = append(subtransforms, m.addMultiEdge(edge))
+               subtransforms = append(subtransforms, m.addMultiEdge(edge)...)
 
 Review comment:
   ... is the operator that says "unroll this slice into the variadic parameter"
   
   The built-in function append([]T, T...) is special in that it's got 
additional compiler support for optimizing the behavior in cases like this. In 
all cases if "subtransforms" has extra capacity, no new backing array for the 
slice will be allocated. 
   
   Other than ensuring we're appending strings, rather than []string to a 
[]string, so the types work out, IIRC a single append call will only lead to at 
most a single allocation of a new slice. 
   eg. The runtime will check the length of the parameter being ...'d, and only 
increase it by at most once.
   Since append is special, I wouldn't expect the returned slice from 
addMultiEdge to be copied.
   
   For other uses, in user defined functions, functionally variadics 
(...string) operate identically to having a slice ([]string) on the receiver 
side, but the caller has the option to pass in disparate parameters as well. 
The main restriction is variadics must be the final parameter.
   I don't know if the slice is copied for those, but I do believe it woul  be 
the slice header (the pointer to the backing array, length, and capacity), and 
not the whole backing array that would be copied.
   
   There's likely nuance going on here that I'm missing, but the above should 
be the right shape of it.
   
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 250315)
    Time Spent: 1h  (was: 50m)

> Side Inputs seems to be non-working in the sdk-go
> -------------------------------------------------
>
>                 Key: BEAM-5354
>                 URL: https://issues.apache.org/jira/browse/BEAM-5354
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-go
>            Reporter: Tomas Roos
>            Assignee: Robert Burke
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Running the contains example fails with
>  
> {code:java}
> Output i0 for step was not found.
> {code}
> This is because of the call to debug.Head (which internally uses SideInput)
> Removing the following line 
> [https://github.com/apache/beam/blob/master/sdks/go/examples/contains/contains.go#L50]
>  
> The pipeline executes well.
>  
> Executed on id's
>  
> go-job-1-1536664417610678545 
> vs
> go-job-1-1536664934354466938
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to