0
votes

I'm using the java api, trying to load data from avro files into BigQuery. When creating external tables, BigQuery automatically detects the schema from the .avro files. Is there a way to specify a schema/data file in GCS when creating a regular BigQuery table for data to be loaded into?

thank you in advance

2

2 Answers

1
votes

You could create manually the schema definition with the configuration.load.schema, however, the documentation says that:

When you load Avro, Parquet, ORC, Cloud Firestore export data, or Cloud Datastore export data, BigQuery infers the schema from the source data.

0
votes

Seems the problem was that the table existed already, and I did not specify the CreateDisposition.CREATE_IF_NEEDED. You do not need to specify the schema at all, just like for the external tables