[ 
https://issues.apache.org/jira/browse/BEAM-8612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tianyang Hu resolved BEAM-8612.
-------------------------------
    Fix Version/s: Not applicable
       Resolution: Fixed

> 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
>             Fix For: Not applicable
>
>          Time Spent: 1h
>  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