{"record":{"id":"b7d31c1143306f0a","repo":"risingwavelabs/risingwave","slug":"cannot-find-table-in-bigquery","errorCode":null,"errorMessage":"Cannot find table in bigquery","messagePattern":"Cannot find table in bigquery","errorType":"exception","errorClass":"SinkError::BigQuery","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/big_query.rs","lineNumber":359,"sourceCode":"            \"NUMERIC\" | \"BIGNUMERIC\"\n        )\n    }\n\n    fn is_data_type_compatible(rw_data_type: &DataType, bigquery_type: &str) -> Result<bool> {\n        if matches!(rw_data_type, DataType::Decimal) {\n            return Ok(Self::is_decimal_type_compatible(bigquery_type));\n        }\n\n        Ok(Self::get_string_and_check_support_from_datatype(rw_data_type)? == bigquery_type)\n    }\n\n    fn check_column_name_and_type(\n        &self,\n        big_query_columns_desc: HashMap<String, String>,\n    ) -> Result<()> {\n        let rw_fields_name = self.schema.fields();\n        if big_query_columns_desc.is_empty() {\n            return Err(SinkError::BigQuery(anyhow::anyhow!(\n                \"Cannot find table in bigquery\"\n            )));\n        }\n        if rw_fields_name.len().ne(&big_query_columns_desc.len()) {\n            return Err(SinkError::BigQuery(anyhow::anyhow!(\n                \"The length of the RisingWave column {} must be equal to the length of the bigquery column {}\",\n                rw_fields_name.len(),\n                big_query_columns_desc.len()\n            )));\n        }\n\n        for i in rw_fields_name {\n            let value = big_query_columns_desc.get(&i.name).ok_or_else(|| {\n                SinkError::BigQuery(anyhow::anyhow!(\n                    \"Column `{:?}` on RisingWave side is not found on BigQuery side.\",\n                    i.name\n                ))\n            })?;","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/big_query.rs#L341-L377","documentation":"During sink validation, `check_column_name_and_type` fetches the existing BigQuery table's column descriptions. If the returned map is empty, BigQuery returned no table schema — typically because the table does not exist in the dataset — and the sink aborts with \"Cannot find table in bigquery\".","triggerScenarios":"Calling `validate` (sink creation) when the target `bigquery.table` does not exist in `bigquery.dataset`, the project/dataset name is wrong, or the service account lacks permission so the table lookup returns nothing.","commonSituations":"Typo in table or dataset name; creating the sink before creating the table in GCP; using a service account scoped to a different project; case-sensitive table-name mismatches.","solutions":["Create the table in BigQuery before creating the sink (or let RW create it if the connector supports that with correct permissions)","Verify `bigquery.table`, `bigquery.dataset`, and the project in the service-account key match the intended GCP resource","Grant the service account BigQuery Data Editor / Metadata Viewer roles so it can read the table schema"],"exampleFix":"-- before: sink created before table exists\nCREATE SINK s INTO bigquery.table = 'events' ...;\n-- after: create table first, then sink\n-- (run in GCP: bq mk --table mydataset.events ...)\nCREATE SINK s INTO bigquery.table = 'events' ...;","handlingStrategy":"validation","validationCode":"bq show --format=json myproject:mydataset.events || echo \"table missing; create it before CREATE SINK\"","typeGuard":null,"tryCatchPattern":"// treat empty schema map as a table-not-found precondition failure\nif big_query_columns_desc.is_empty() {\n    return Err(anyhow!(\"target BigQuery table not found; create it or fix bigquery.table/bigquery.dataset\"));\n}","preventionTips":["Create the BigQuery table before the sink","bq show the fully qualified table to confirm existence and permissions","Verify the service account can read the dataset metadata"],"tags":["bigquery","validation","schema"],"backgroundTag":"entity-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}