risingwavelabs/risingwave · error · SinkError::BigQuery
Don't support Variant
Error message
Don't support Variant
What it means
When building the protobuf schema used to encode rows for the BigQuery Storage Write API, each RisingWave column type is mapped to a protobuf field type. VARIANT has no protobuf mapping in this sink, so building the schema aborts with this error during sink creation.
Source
Thrown at src/connector/src/sink/big_query.rs:1005
DataType::Timestamp => field.r#type = Some(field_descriptor_proto::Type::String.into()),
DataType::Timestamptz => field.r#type = Some(field_descriptor_proto::Type::String.into()),
DataType::Interval => field.r#type = Some(field_descriptor_proto::Type::String.into()),
DataType::Struct(s) => {
field.r#type = Some(field_descriptor_proto::Type::Message.into());
let name = format!("Struct{}", name);
let sub_proto = build_protobuf_schema(s.iter(), name.clone())?;
field.type_name = Some(name);
return Ok((field, Some(sub_proto)));
}
DataType::List(l) => {
let (mut field, proto) = build_protobuf_field(l.elem(), index, name)?;
field.label = Some(field_descriptor_proto::Label::Repeated.into());
return Ok((field, proto));
}
DataType::Bytea => field.r#type = Some(field_descriptor_proto::Type::Bytes.into()),
DataType::Jsonb => field.r#type = Some(field_descriptor_proto::Type::String.into()),
DataType::Variant => {
return Err(SinkError::BigQuery(anyhow::anyhow!("Don't support Variant")));
}
DataType::Serial => field.r#type = Some(field_descriptor_proto::Type::Int64.into()),
DataType::Float32 | DataType::Int256 => {
return Err(SinkError::BigQuery(anyhow::anyhow!(
"Don't support Float32 and Int256"
)));
}
DataType::Map(_) => return Err(SinkError::BigQuery(anyhow::anyhow!("Don't support Map"))),
DataType::Vector(_) => {
return Err(SinkError::BigQuery(anyhow::anyhow!("Don't support Vector")));
}
}
Ok((field, None))
}
#[cfg(test)]
mod test {
View on GitHub (pinned to 6469eb736d)
Solutions
- Cast the VARIANT column to JSONB or VARCHAR in the sink query.
- Exclude the VARIANT column via an explicit SELECT column list in `CREATE SINK ... AS SELECT`.
- Use a different sink target that supports VARIANT, or file an issue to add VARIANT support to the BigQuery connector.
- Validate the sink schema early in dev to catch unsupported types before production.
Example fix
// before CREATE SINK s FROM mv; -- mv contains a variant column // after CREATE SINK s AS SELECT id, event_data::jsonb AS event_data FROM mv;
Defensive patterns
Strategy: validation
Validate before calling
-- Reject VARIANT columns before CREATE SINK: -- SELECT count(*) FROM <mv> ... ; or inspect the schema: -- any column with data_type 'variant' will fail BigQuery sink creation.
Try / catch
match sink_creation {
Err(SinkError::BigQuery(e)) if e.to_string().contains("Don't support Variant") => {
// cast the variant column to jsonb/varchar in the sink query and retry
}
other => other?,
} Prevention
- Never route VARIANT columns to the BigQuery sink; cast to JSONB/VARCHAR upstream.
- Check column types in the MV schema before CREATE SINK.
- Re-validate sinks after adding columns to upstream MVs.
- Keep a list of supported types (BigQuery sink rejects Variant, Float32, Int256, Map, Vector).
When it happens
Trigger: BigQuerySinkWriter::new -> build_protobuf_schema -> build_protobuf_field encounters a column of DataType::Variant in the sink schema.
Common situations: A source/table containing VARIANT columns is connected to a BigQuery sink; a VARIANT column was added to the MV after the sink was planned.
Related errors
- Don't support Float32 and Int256
- Don't support Map
- REAL is not supported for BigQuery sink. Please convert to F
- VARIANT is not supported for BigQuery sink.
- INT256 is not supported for BigQuery sink.
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/140f5b4cbd856d6d.
Report an issue: GitHub.