Hi,
Regarding your question on how to create the BQ schema dynamically, I would suggest that you checked [1] to have a better understading on how to use the Schema autodetection. According to [2], "Schema auto-detection is not used with Avro files, Parquet files, ORC files, Firestore export files, or Datastore export files. When you load these files into BigQuery, the table schema is automatically retrieved from the self-describing source data". In case you want to insert JSON or CSV data, you should use the .setAutodetect() flag to true. Please refer to [2] to see how it is done.
In order to create an empty table without a schema definition, please refer to [3]. In case you want to create a table with a schema definition, you should specify the schema using one of the proposed options. Please take a look at the documentation on how to define a schema in BQ [5].
Additionally, check the specific documentation on how to load avro data into a new table [6].
________________________________
[1] -
[2] -
[3] -
[4] -
[5] -
[6] -