{"record":{"id":"61c3e63f96915674","repo":"risingwavelabs/risingwave","slug":"the-length-of-the-risingwave-column-must-be-equ","errorCode":null,"errorMessage":"The length of the RisingWave column {} must be equal to the length of the bigquery column {}","messagePattern":"The length of the RisingWave column (.+?) must be equal to the length of the bigquery column (.+?)","errorType":"validation","errorClass":"SinkError::BigQuery","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/big_query.rs","lineNumber":364,"sourceCode":"        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            })?;\n            let data_type_string = Self::get_string_and_check_support_from_datatype(&i.data_type)?;\n            if !Self::is_data_type_compatible(&i.data_type, value)? {\n                return Err(SinkError::BigQuery(anyhow::anyhow!(\n                    \"Data type mismatch for column `{:?}`. BigQuery side: `{:?}`, RisingWave side: `{:?}`. \",\n                    i.name,","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/big_query.rs#L346-L382","documentation":"`check_column_name_and_type` requires the RisingWave sink schema and the existing BigQuery table to have the same number of columns. When `rw_fields_name.len() != big_query_columns_desc.len()`, validation fails with this error naming both counts.","triggerScenarios":"Sink creation (`validate`) where the materialized view has N columns but the pre-existing BigQuery table has M != N columns — e.g. the table has extra columns, or the MV was altered after the table was created.","commonSituations":"Table created manually with additional GCP-required columns (e.g. load-time partitioning columns); MV schema evolved but the BigQuery table was not recreated; column dropped on one side only.","solutions":["Align the schemas: recreate the BigQuery table with exactly the same columns as the RisingWave relation","Or recreate the sink against a materialized view whose columns match the table","Or drop and recreate the sink with a fresh auto-created table"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bq show --format=json proj:ds.tbl | jq '.schema.fields | length'  # compare with:\nSELECT count(*) FROM information_schema.columns WHERE table_name='<mv>';","typeGuard":null,"tryCatchPattern":"if rw_len != bq_len {\n    return Err(anyhow!(\"column count differs (rw={} bq={}); align schemas before sinking\", rw_len, bq_len));\n}","preventionTips":["Keep BigQuery table DDL in sync with MV schema changes","Diff column lists on both sides before CREATE SINK","Recreate both MV and table together when schema evolves"],"tags":["bigquery","schema","validation"],"backgroundTag":"shape-mismatch","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"}