youngoli opened a new issue, #21789:
URL: https://github.com/apache/beam/issues/21789

   ### What happened?
   
   Using `register.Function` (and presumable any other registration function) 
on an anonymous struct causes a panic immediately. This happens because 
anonymous types are unregisterable, but the problem is that with generic 
registration, types are registered from these function signatures, which means 
any functions with anonymous parameters can't be registered at all, and 
therefore any types that only appear in the function signature are in effect 
unregisterable.
   
   The preference here would be for unregisterable parameters to simply be 
skipped, and for registration to fail gracefully. That is, register everything 
that can be registered and skip everything that can't (ideally with warnings 
explaining what isn't being registered).
   
   Example abbreviated stacktrace:
   ```
   panic: invalid registration type: struct { Counter *int64 
"beam:\"counter\""; Rand_data *struct { Flip *bool "beam:\"flip\""; Num *int64 
"beam:\"num\""; Word *string "beam:\"word\"" } "beam:\"rand_data\"" }
   
   goroutine 1 [running]:
   
github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime.RegisterType({0x118ecb8?,
 0xe7df60?})
       {...}/beam/sdks/go/pkg/beam/core/runtime/types.go:39 +0x24e
   
github.com/apache/beam/sdks/v2/go/pkg/beam/register.registerMethodTypes({0x118ecb8,
 0xda8280})
       {...}/beam/sdks/go/pkg/beam/register/register.go:8487 +0xba
   
github.com/apache/beam/sdks/v2/go/pkg/beam/register.Function1x1[...](0x104db10?)
       {...}/beam/sdks/go/pkg/beam/register/register.go:3258 +0xc5
   ```
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: sdk-go


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to