[Bug]: BQ TableRow does not accept column named 'f'
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
### What happened?
When working with a BQ table with a column named 'f', construction of a `TableRow` object fails with
```
java.lang.IllegalArgumentException: Can not set java.util.List field com.google.api.services.bigquery.model.TableRow.f to java.lang.String
```
This happens because `TableRow` is a `GenericJson` and has a [key field](https://github.com/googleapis/google-api-java-client-services/blob/ac015ce38a6494496191ed8a590d98ca58c75919/clients/google-api-services-bigquery/v2/2.0.0/com/google/api/services/bigquery/model/TableRow.java#L37) named `f` expecting a `List`.
When reading the javadoc for `TableRow`, it seems to me that this model is supposed to represent a BQ resultset in the form
```json
{
"f": [{"v": 1}, {"v": "value"}]
}
```
beam abuses the `GenericJson` capability and relies on the unknown fields to encode the result in the form
```json
{
"column1": 1,
"column2": "value"
}
```
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
Contributor guide
Research direction
Start with the linked TableRow.java key field and the GenericJson behavior described in the issue, then trace where Beam constructs TableRow objects for BigQuery results. Done means a BigQuery column named 'f' can be represented without the IllegalArgumentException while the documented resultset representation remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100