{"record":{"id":"359ca65c6d869707","repo":"risingwavelabs/risingwave","slug":"interval-is-not-supported-for-bigquery-sink-pleas","errorCode":null,"errorMessage":"INTERVAL is not supported for BigQuery sink. Please convert to VARCHAR or other supported types.","messagePattern":"INTERVAL is not supported for BigQuery sink\\. Please convert to VARCHAR or other supported types\\.","errorType":"validation","errorClass":"SinkError::BigQuery","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/big_query.rs","lineNumber":458,"sourceCode":"        let tfs = match &rw_field.data_type {\n            DataType::Boolean => TableFieldSchema::bool(&rw_field.name),\n            DataType::Int16 | DataType::Int32 | DataType::Int64 | DataType::Serial => {\n                TableFieldSchema::integer(&rw_field.name)\n            }\n            DataType::Float32 => {\n                return Err(SinkError::BigQuery(anyhow::anyhow!(\n                    \"REAL is not supported for BigQuery sink. Please convert to FLOAT64 or other supported types.\"\n                )));\n            }\n            DataType::Float64 => TableFieldSchema::float(&rw_field.name),\n            DataType::Decimal => TableFieldSchema::numeric(&rw_field.name),\n            DataType::Date => TableFieldSchema::date(&rw_field.name),\n            DataType::Varchar => TableFieldSchema::string(&rw_field.name),\n            DataType::Time => TableFieldSchema::time(&rw_field.name),\n            DataType::Timestamp => TableFieldSchema::date_time(&rw_field.name),\n            DataType::Timestamptz => TableFieldSchema::timestamp(&rw_field.name),\n            DataType::Interval => {\n                return Err(SinkError::BigQuery(anyhow::anyhow!(\n                    \"INTERVAL is not supported for BigQuery sink. Please convert to VARCHAR or other supported types.\"\n                )));\n            }\n            DataType::Struct(st) => {\n                let mut sub_fields = Vec::with_capacity(st.len());\n                for (name, dt) in st.iter() {\n                    let rw_field = Field::with_name(dt.clone(), name);\n                    let field = Self::map_field(&rw_field)?;\n                    sub_fields.push(field);\n                }\n                TableFieldSchema::record(&rw_field.name, sub_fields)\n            }\n            DataType::List(lt) => {\n                let inner_field =\n                    Self::map_field(&Field::with_name(lt.elem().clone(), &rw_field.name))?;\n                TableFieldSchema {\n                    mode: Some(\"REPEATED\".to_owned()),\n                    ..inner_field","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/big_query.rs#L440-L476","documentation":"`map_field` rejects `DataType::Interval` because BigQuery has no INTERVAL column type. The sink instructs users to convert INTERVAL data to VARCHAR or another supported type rather than guessing a serialization.","triggerScenarios":"Sinking to BigQuery when the schema includes an INTERVAL column, e.g. from date/time arithmetic (`end_time - start_time`).","commonSituations":"Users computing durations with subtraction of timestamps or date arithmetic and trying to persist the resulting INTERVAL values in BigQuery.","solutions":["Cast the INTERVAL column to VARCHAR in the view feeding the sink.","Convert the interval to a numeric duration (e.g. EXTRACT(EPOCH ...) or seconds) and sink that as INT64/FLOAT64.","Restructure the query to avoid producing INTERVAL columns (store start/end timestamps instead)."],"exampleFix":"-- before\nCREATE MATERIALIZED VIEW mv AS SELECT (end_ts - start_ts) AS duration FROM events;\n\n-- after\nCREATE MATERIALIZED VIEW mv AS SELECT EXTRACT(EPOCH FROM (end_ts - start_ts)) AS duration_seconds FROM events;","handlingStrategy":"validation","validationCode":"-- Find INTERVAL columns before sinking:\nSELECT column_name, data_type\nFROM rw_catalog.rw_columns\nWHERE relation_id = ('<schema>.<mv_name>')::regclass\n  AND data_type ILIKE '%interval%';","typeGuard":"fn is_bigquery_supported(dt: &DataType) -> bool {\n    !matches!(dt, DataType::Interval)\n}","tryCatchPattern":null,"preventionTips":["Store durations as numeric seconds/milliseconds instead of INTERVAL in sinked views.","Cast INTERVAL to VARCHAR only when the raw value is acceptable downstream.","Avoid timestamp subtraction in views feeding BigQuery sinks, or extract epochs immediately."],"tags":["bigquery","sink","unsupported-type","interval"],"backgroundTag":"unsupported-operation","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"}