I am trying to use the bigquery export functionality to push data out to GCS in json format. At the end of the process inorder to validate the count of exported records in the GCS file, I am creating an external table with auto schema detection just to take a count of records in the GCS files exported.
This works for single exported files. But for tables greater than 1gb in size, i use the wild card inorder to split into multiple files. This results in multiple files with some empty files as well created.
The empty files are causing an error while querying the external table : "400 Schema has no fields".
Please suggest any ideas to:
- Either make sure that empty files do not get created in the export operation for multiple files scenario
- To ignore empty files in the external table creation.
- Any other way to take count of records in GCS after the export operation