Problem
Some BigQuery query Audit Logs do not have any values for protoPayload.serviceData.jobCompletedEvent.job.jobStatistics.referencedTables populated.
Environment
- BigQuery Audit Logs
Solution
The feature works as intended. Using cached results allows BigQuery to skip scanning the actual tables.
Disabling result caching will force BigQuery to scan all related tables and corresponding Audit Log values for protoPayload.serviceData.jobCompletedEvent.job.jobStatistics.referencedTables will be fully populated, but every query will be billed.
Workaround
- Extract referencedTables values from the original query job located in the Audit Logs.
Cause
When cached results are retrieved, tables are not scanned and therefore the referencedTables field is not populated.