apache / apache/beam

[Bug]: WriteToBigQuery FILE_LOADS method should support writing schema'd PCollections.

Open
#28,162 2 comments 0 reactions 1 assignee Claimed by @nikitagrover19 View on GitHub
bug io P2 python
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What happened?

For example, I would expect the following to work:

```
import apache_beam as beam
with beam.Pipeline(options=PipelineOptions([
'--project=apache-beam-testing',
'--temp_location=gs://temp-storage-for-end-to-end-tests/temp-it',
'--region=us-central1',
])) as p:
pcoll = p | beam.io.ReadFromBigQuery(
table='apache-beam-testing:beam_bigquery_io_test.taxi_small',
output_type='BEAM_ROW')
pcoll | beam.io.WriteToBigQuery(
'apache-beam-testing:beam_bigquery_io_test.test_2023_08_11',
temp_file_format='AVRO')
```

The schema can be automatically inferred with `schema_from_element_type(pcoll.element_type)` (and perhaps in this case we should default to the superior avro format automatically).

### Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

### Issue Components

- [X] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [X] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.