Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Missing datasets in Information_schema and audit tables

Hello, I'm encountering two issues with BigQuery on GCP:

1. When querying `region-eu.INFORMATION_SCHEMA.SCHEMATA`, I don't get any results despite having datasets in my project. I have checked permissions and region settings. Are there other settings I should verify?

2. I'm querying BigQuery audit logs to analyze usage and billing information but the `totalBilledGB` field always returns null for our datasets although other informations are present. Here’s the query:

 

 

 

SELECT
    DATE(timestamp) AS event_date,
    REGEXP_EXTRACT(protopayload_auditlog.resourceName, '^projects/[^/]+/datasets/([^/]+)/tables') AS datasetRef,
    REGEXP_EXTRACT(protopayload_auditlog.resourceName, 'projects/[^/]+/datasets/[^/]+/tables/([^/]+)') AS table_name,
    COUNTIF(JSON_QUERY(protopayload_auditlog.metadataJson, "$.tableDataRead") IS NOT NULL) AS dataReadEvents,
    COUNTIF(JSON_QUERY(protopayload_auditlog.metadataJson, "$.tableDataChange") IS NOT NULL) AS dataChangeEvents,
    SUM(CAST(JSON_EXTRACT_SCALAR(protopayload_auditlog.metadataJson,"$.jobChange.job.jobStats.queryStats.totalBilledBytes") AS INT64)/ POWER(2, 40)) AS totalBilledGB,
    protopayload_auditlog.authenticationInfo.principalEmail AS user_email
FROM
    `project_id.auditlog_dataset.cloudaudit_googleapis_com_data_access_*`
GROUP BY
    event_date, datasetRef, table_name, user_email

 

 

 

 

0 1 168
1 REPLY 1