You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "lostluck (via GitHub)" <gi...@apache.org> on 2023/04/17 17:03:22 UTC
[GitHub] [beam] lostluck opened a new issue, #26298: [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types.
lostluck opened a new issue, #26298:
URL: https://github.com/apache/beam/issues/26298
### What happened?
On distributed runners, the type must be registered to ensure it's serialized correctly. This can cause problems for BigQueryIO's "Null" type wrappers, which will lose their type identity going through beam serialization.
The user side solution is to register their type with beam.
```
func init() {
beam.RegisterType(reflect.TypeOf((*BigQueryEntity)(nil)).Elem())
}
```
Or to use the `register` package on a downstream DoFn, which will register input and output types from the DoFn's ProcessElement method.
```
func init() {
register.DoFn1x1[BigQueryEntity, Outut]((*myDoFn)(nil))
}
```
However it can be easy to forget to do this. So we can have the BigqueryIO do this at pipeline construction, to make the behavior clear and avoid user issues at pipeline execution time.
By adding to the internal [`mustInferSchema`](https://github.com/apache/beam/blob/sdks/v2.46.0/sdks/go/pkg/beam/io/bigqueryio/bigquery.go#L128) function, and have it get the key and look up the type with the beam runtime functions [`runtime.TypeKey` and `runtime.LookupType`. ](https://github.com/apache/beam/blob/sdks/v2.46.0/sdks/go/pkg/beam/core/runtime/types.go#L50
Note, that due to current limitations on looking up arbitrary types in Go, type registration *must* happen before `beam.Init` is called, so we can't simply register types there. We need to fail with a clear error message and instructions.
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [X] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
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: github-unsubscribe@beam.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] listux commented on issue #26298: [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types.
Posted by "listux (via GitHub)" <gi...@apache.org>.
listux commented on issue #26298:
URL: https://github.com/apache/beam/issues/26298#issuecomment-1536064218
I would love to help and take this bug, please let me know if that's ok and I'll open a PR.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] listux commented on issue #26298: [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types.
Posted by "listux (via GitHub)" <gi...@apache.org>.
listux commented on issue #26298:
URL: https://github.com/apache/beam/issues/26298#issuecomment-1537197208
.take-issue
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types. [beam]
Posted by "mohamedawnallah (via GitHub)" <gi...@apache.org>.
mohamedawnallah commented on issue #26298:
URL: https://github.com/apache/beam/issues/26298#issuecomment-2651861871
It seems this issue has been inactive for a while, and no one has submitted a PR to address it. I'd like to take it on. 🙏
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types. [beam]
Posted by "mohamedawnallah (via GitHub)" <gi...@apache.org>.
mohamedawnallah commented on issue #26298:
URL: https://github.com/apache/beam/issues/26298#issuecomment-2651862022
.take-issue
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types. [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm closed issue #26298: [Bug][Go SDK] Native BigQuery IO should require registrations for passed in types.
URL: https://github.com/apache/beam/issues/26298
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org