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

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

                Author: ASF GitHub Bot
            Created on: 14/Nov/19 01:00
            Start Date: 14/Nov/19 01:00
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on issue #10066: [BEAM-8612] Convert 
[]beam.T to the underlying type []T when passed to a universal type.
URL: https://github.com/apache/beam/pull/10066#issuecomment-553675175
 
 
   I looked and the only places beam is using Convert right now is the 
   reflection based iterator code:
   
https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/core/runtime/exec/input.go#L174
   and in handling side inputs:
   
https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/core/runtime/exec/fn.go#L317
   
   Both could be optimized to use ConvertFn instead, but neither have a 
pressing need for it side inputs converting slices of values more than already 
slow reflection iterations.
 
----------------------------------------------------------------
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: 343042)
    Time Spent: 40m  (was: 0.5h)

> Convert []beam.T to the underlying type []T when passed to a DoFn with 
> universal typed (beam.X) input
> -----------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-8612
>                 URL: https://issues.apache.org/jira/browse/BEAM-8612
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-go
>            Reporter: Tianyang Hu
>            Assignee: Tianyang Hu
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Say there are two DoFn: f1, f2.
> - f1 declares the output type as []beam.T, and each element has the 
> underlying type int.
> - f2 declares the input type as []int
> Passing f1 output to f2 works well. The conversion from []beam.T to []int 
> happens at: 
> https://github.com/apache/beam/blob/c7be0643934a87d73483cf1fd3199a425508b03c/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go#L108
> But it doesn't work if f2 declares the input type as beam.X and type casts it 
> to []int. This is because there's no type conversion when passing []beam.T to 
> beam.X.
> We may consider supporting the above case by converting []beam.T to the 
> underlying type []T when it's passed to a universal type.
> An issue is that if []beam.T is nil or empty, we don't know its underlying 
> element type (unless we know which concrete type beam.T or beam.X is bound 
> to, but this mapping doesn't seem to be kept at runtime?). In such case, we 
> have to pass []beam.T to beam.X as is.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to