{"record":{"id":"986db039bd4f6f2c","repo":"risingwavelabs/risingwave","slug":"missing-array-type","errorCode":null,"errorMessage":"missing array type","messagePattern":"missing array type","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/postgres.rs","lineNumber":801,"sourceCode":"        SeaType::DoublePrecision => Ok(PgType::FLOAT8),\n        SeaType::Varchar(_) => Ok(PgType::VARCHAR),\n        SeaType::Char(_) => Ok(PgType::CHAR),\n        SeaType::Text => Ok(PgType::TEXT),\n        SeaType::Bytea => Ok(PgType::BYTEA),\n        SeaType::Timestamp(_) => Ok(PgType::TIMESTAMP),\n        SeaType::TimestampWithTimeZone(_) => Ok(PgType::TIMESTAMPTZ),\n        SeaType::Date => Ok(PgType::DATE),\n        SeaType::Time(_) => Ok(PgType::TIME),\n        SeaType::TimeWithTimeZone(_) => Ok(PgType::TIMETZ),\n        SeaType::Interval(_) => Ok(PgType::INTERVAL),\n        SeaType::Boolean => Ok(PgType::BOOL),\n        SeaType::Point => Ok(PgType::POINT),\n        SeaType::Uuid => Ok(PgType::UUID),\n        SeaType::Json => Ok(PgType::JSON),\n        SeaType::JsonBinary => Ok(PgType::JSONB),\n        SeaType::Array(t) => {\n            let Some(t) = t.col_type.as_ref() else {\n                bail!(\"missing array type\")\n            };\n            match t.as_ref() {\n                // RW only supports 1 level of nesting.\n                SeaType::SmallInt => Ok(PgType::INT2_ARRAY),\n                SeaType::Integer => Ok(PgType::INT4_ARRAY),\n                SeaType::BigInt => Ok(PgType::INT8_ARRAY),\n                SeaType::Decimal(_) => Ok(PgType::NUMERIC_ARRAY),\n                SeaType::Numeric(_) => Ok(PgType::NUMERIC_ARRAY),\n                SeaType::Real => Ok(PgType::FLOAT4_ARRAY),\n                SeaType::DoublePrecision => Ok(PgType::FLOAT8_ARRAY),\n                SeaType::Varchar(_) => Ok(PgType::VARCHAR_ARRAY),\n                SeaType::Char(_) => Ok(PgType::CHAR_ARRAY),\n                SeaType::Text => Ok(PgType::TEXT_ARRAY),\n                SeaType::Bytea => Ok(PgType::BYTEA_ARRAY),\n                SeaType::Timestamp(_) => Ok(PgType::TIMESTAMP_ARRAY),\n                SeaType::TimestampWithTimeZone(_) => Ok(PgType::TIMESTAMPTZ_ARRAY),\n                SeaType::Date => Ok(PgType::DATE_ARRAY),\n                SeaType::Time(_) => Ok(PgType::TIME_ARRAY),","sourceCodeStart":783,"sourceCodeEnd":819,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/postgres.rs#L783-L819","documentation":"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'.","triggerScenarios":"`type_mapping` invoking `sea_type_to_pg_type` on an array column whose `SeaType::Array(t)` inner `col_type` is `None`.","commonSituations":"Schema discovery producing array columns without element type info (e.g. multi-dimensional arrays like `text[][]`, or discovery bugs on exotic element types).","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"],"exampleFix":"-- before\nCREATE TABLE t (tags TEXT[][]);\n-- after\nCREATE TABLE t (tags TEXT[]);","handlingStrategy":"type-guard","validationCode":"fn pg_array_has_element(t: &SeaType) -> bool {\n    matches!(t, SeaType::Array(def) if def.col_type.is_some())\n}","typeGuard":"fn is_well_typed_array(t: &SeaType) -> bool {\n    match t {\n        SeaType::Array(def) => def.col_type.as_ref()\n            .map(|inner| !matches!(inner.as_ref(), SeaType::Array(_)))\n            .unwrap_or(false),\n        _ => true,\n    }\n}","tryCatchPattern":"let mapping = type_mapping(...).map_err(|e| {\n    if e.to_string().contains(\"missing array type\") {\n        PlanError::UnsupportedArrayColumn(e)\n    } else { PlanError::Other(e) }\n})?;","preventionTips":["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"],"tags":["postgres","array","type-mapping"],"backgroundTag":"unsupported-dtype","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"}