Skip to content

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

Description

@robertwb

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

  • Component: Python SDK
  • Component: Java SDK
  • 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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions