risingwavelabs/risingwave · error · anyhow::Error
missing array type
Error message
missing array type
What it means
When converting a SeaQL type back to a Postgres type (`sea_type_to_pg_type`, used by `type_mapping`), an `Array` element without a `col_type` cannot be mapped to a concrete Pg array type, so the function bails with 'missing array type'.
Source
Thrown at src/connector/src/connector_common/postgres.rs:801
SeaType::DoublePrecision => Ok(PgType::FLOAT8),
SeaType::Varchar(_) => Ok(PgType::VARCHAR),
SeaType::Char(_) => Ok(PgType::CHAR),
SeaType::Text => Ok(PgType::TEXT),
SeaType::Bytea => Ok(PgType::BYTEA),
SeaType::Timestamp(_) => Ok(PgType::TIMESTAMP),
SeaType::TimestampWithTimeZone(_) => Ok(PgType::TIMESTAMPTZ),
SeaType::Date => Ok(PgType::DATE),
SeaType::Time(_) => Ok(PgType::TIME),
SeaType::TimeWithTimeZone(_) => Ok(PgType::TIMETZ),
SeaType::Interval(_) => Ok(PgType::INTERVAL),
SeaType::Boolean => Ok(PgType::BOOL),
SeaType::Point => Ok(PgType::POINT),
SeaType::Uuid => Ok(PgType::UUID),
SeaType::Json => Ok(PgType::JSON),
SeaType::JsonBinary => Ok(PgType::JSONB),
SeaType::Array(t) => {
let Some(t) = t.col_type.as_ref() else {
bail!("missing array type")
};
match t.as_ref() {
// RW only supports 1 level of nesting.
SeaType::SmallInt => Ok(PgType::INT2_ARRAY),
SeaType::Integer => Ok(PgType::INT4_ARRAY),
SeaType::BigInt => Ok(PgType::INT8_ARRAY),
SeaType::Decimal(_) => Ok(PgType::NUMERIC_ARRAY),
SeaType::Numeric(_) => Ok(PgType::NUMERIC_ARRAY),
SeaType::Real => Ok(PgType::FLOAT4_ARRAY),
SeaType::DoublePrecision => Ok(PgType::FLOAT8_ARRAY),
SeaType::Varchar(_) => Ok(PgType::VARCHAR_ARRAY),
SeaType::Char(_) => Ok(PgType::CHAR_ARRAY),
SeaType::Text => Ok(PgType::TEXT_ARRAY),
SeaType::Bytea => Ok(PgType::BYTEA_ARRAY),
SeaType::Timestamp(_) => Ok(PgType::TIMESTAMP_ARRAY),
SeaType::TimestampWithTimeZone(_) => Ok(PgType::TIMESTAMPTZ_ARRAY),
SeaType::Date => Ok(PgType::DATE_ARRAY),
SeaType::Time(_) => Ok(PgType::TIME_ARRAY),View on GitHub (pinned to 6469eb736d)
Solutions
- Ensure the upstream array column is a single-level array of a supported scalar type (`int[]`, `text[]`, `numeric[]`, etc.)
- Cast problematic columns to `text` upstream and parse in RisingWave
- Re-run schema discovery after normalizing the upstream table definition
Example fix
-- before CREATE TABLE t (tags TEXT[][]); -- after CREATE TABLE t (tags TEXT[]);
Defensive patterns
Strategy: type-guard
Validate before calling
fn pg_array_has_element(t: &SeaType) -> bool {
matches!(t, SeaType::Array(def) if def.col_type.is_some())
} Type guard
fn is_well_typed_array(t: &SeaType) -> bool {
match t {
SeaType::Array(def) => def.col_type.as_ref()
.map(|inner| !matches!(inner.as_ref(), SeaType::Array(_)))
.unwrap_or(false),
_ => true,
}
} Try / catch
let mapping = type_mapping(...).map_err(|e| {
if e.to_string().contains("missing array type") {
PlanError::UnsupportedArrayColumn(e)
} else { PlanError::Other(e) }
})?; Prevention
- Restrict CDC source tables to single-level arrays of supported scalars
- Replace multi-dimensional arrays with JSONB or flattened columns
- Run discovery twice on exotic schemas and diff type info for completeness
When it happens
Trigger: `type_mapping` invoking `sea_type_to_pg_type` on an array column whose `SeaType::Array(t)` inner `col_type` is `None`.
Common situations: Schema discovery producing array columns without element type info (e.g. multi-dimensional arrays like `text[][]`, or discovery bugs on exotic element types).
Related errors
- ARRAY type missing element type
- unsupported array type: {:?}
- {:?} data type is not supported
- pgvector type `vector` is missing dimension, expected `vecto
- nested array type is not supported
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/986db039bd4f6f2c.
Report an issue: GitHub.