Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: BigQuery SchemaUpdateOptions fails depending on dataset size #33152

Open
2 of 17 tasks
Shuyu-Current opened this issue Nov 18, 2024 · 0 comments
Open
2 of 17 tasks

Comments

@Shuyu-Current
Copy link

Shuyu-Current commented Nov 18, 2024

What happened?

When writing a large amount of data to an existing non-partitioned BigQuery table using WRITE_TRUNCATE, Beam will use temp tables to write intermediate results before copying to the destination table. These temp tables will inherit the destination table's schema if SchemaUpdateOptions are not set (noted in #24471). If a schema change is written, this will fail as the temp table's schema does not match the schema of the data being written:
"Error while reading data, error message: JSON parsing error in row starting at position : No such field: ".
Setting the SchemaUpdateOptions fixes this issue. However, if the same code is used to write a small amount of data to the same table, temp tables will not be used, and since we are writing directly to the destination with WRITE_TRUNCATE, SchemaUpdateOptions are not allowed (noted in BigQuery API documentation):
"Schema update options should only be specified with WRITE_APPEND disposition, or with WRITE_TRUNCATE disposition on a table partition."
This results in inconsistent behavior, where the write will fail depending on the dataset size, regardless of SchemaUpdateOptions being set.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant