risingwavelabs/risingwave · error

unsupported array type: {:?}

Error message

unsupported array type: {:?}

What it means

Inside sea_type_to_pg_type, when a column's element type inside an array cannot be mapped to a concrete PostgreSQL array element type (an unhandled inner type in the array arm), the mapper bails with this error. It means the array's element type is not one of the supported scalar types.

Source

Thrown at src/connector/src/connector_common/postgres.rs:842

                SeaType::Uuid => Ok(PgType::UUID_ARRAY),
                SeaType::Json => Ok(PgType::JSON_ARRAY),
                SeaType::JsonBinary => Ok(PgType::JSONB_ARRAY),
                SeaType::Array(_) => bail!("nested array type is not supported"),
                SeaType::Unknown(name) => {
                    // Treat as enum type
                    Ok(PgType::new(
                        name.clone(),
                        0,
                        PgKind::Array(PgType::new(
                            name.clone(),
                            0,
                            PgKind::Enum(vec![]),
                            "".into(),
                        )),
                        "".into(),
                    ))
                }
                _ => bail!("unsupported array type: {:?}", t),
            }
        }
        SeaType::Unknown(name) => {
            // Treat as enum type
            Ok(PgType::new(
                name.clone(),
                0,
                PgKind::Enum(vec![]),
                "".into(),
            ))
        }
        _ => bail!("unsupported type: {:?}", sea_type),
    }
}

#[cfg(test)]
mod tests {
    use super::{

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Change the array element type to a supported scalar (int, text, bool, uuid, jsonb, etc.)
  2. Cast the column to a supported array type in the sink query
  3. Store the column as a JSONB string instead of an array

Example fix

// before
col custom_type[]  -- element type unsupported
// after
col text[]  -- or cast: col::text[]
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_ELEM: &[DataType] = &[DataType::Int16, DataType::Int32, DataType::Int64, DataType::Varchar, DataType::Boolean, DataType::Timestamp];
fn array_elem_supported(t: &DataType) -> bool {
    match t { DataType::List(e) => SUPPORTED_ELEM.contains(&*e), _ => true }
}

Type guard

fn is_supported_array(t: &DataType) -> bool {
    matches!(t, DataType::List(e) if !matches!(&**e, DataType::List(_)))
}

Prevention

When it happens

Trigger: Creating a Postgres sink whose source table has an array column with an element type not covered by the match arms (e.g. arrays of unknown/custom inner types beyond the handled Interval/Boolean/Point/Uuid/Json cases).

Common situations: Sinking tables with exotic array element types or user-defined types inside arrays to Postgres; schema drift upstream introduces an array element type the mapper does not handle.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/097991878086cb38. Report an issue: GitHub.