0
votes

I am trying to create an empty external BigQuery table using the java API.

In our flow there is a gap between the table creation and the arrival of the avro file, so I need to create the table without any underlying data. The ExternalTableDefinition allows specifying a sourceUri and a schema.

So I tried with a null sourceUri and a valid schema. I get this error: "Specifying a schema is disallowed for STORAGE_FORMAT_AVRO"

Why the limitation?

Is there any way to create an external avro table based on the schema only?

thanks in advance

1

1 Answers

1
votes

You cannot create an empty external table

But, you can try using dummy/empty avro file that will define your schema and use it while creating external table from a source.
Important - you can use wildcard as in gs://mybucket/path/to/myAvroFiles* so late arrival files that match it will be available via that external table