{"record":{"id":"ff2dd395491c5da6","repo":"risingwavelabs/risingwave","slug":"array-type-missing-element-type","errorCode":null,"errorMessage":"ARRAY type missing element type","messagePattern":"ARRAY type missing element type","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/postgres.rs","lineNumber":696,"sourceCode":"        SeaType::DoublePrecision => DataType::Float64,\n        SeaType::Varchar(_) | SeaType::Char(_) | SeaType::Text => DataType::Varchar,\n        SeaType::Bytea => DataType::Bytea,\n        SeaType::Timestamp(_) => DataType::Timestamp,\n        SeaType::TimestampWithTimeZone(_) => DataType::Timestamptz,\n        SeaType::Date => DataType::Date,\n        SeaType::Time(_) | SeaType::TimeWithTimeZone(_) => DataType::Time,\n        SeaType::Interval(_) => DataType::Interval,\n        SeaType::Boolean => DataType::Boolean,\n        SeaType::Point => postgres_point_type(),\n        SeaType::Uuid => DataType::Varchar,\n        SeaType::Xml => DataType::Varchar,\n        SeaType::Json => DataType::Jsonb,\n        SeaType::JsonBinary => DataType::Jsonb,\n        SeaType::Array(def) => {\n            let item_type = match def.col_type.as_ref() {\n                Some(ty) => sea_type_to_rw_type(ty.as_ref())?,\n                None => {\n                    return Err(anyhow!(\"ARRAY type missing element type\").into());\n                }\n            };\n\n            DataType::list(item_type)\n        }\n        SeaType::PgLsn => DataType::Int64,\n        SeaType::Cidr\n        | SeaType::Inet\n        | SeaType::MacAddr\n        | SeaType::MacAddr8\n        | SeaType::Int4Range\n        | SeaType::Int8Range\n        | SeaType::NumRange\n        | SeaType::TsRange\n        | SeaType::TsTzRange\n        | SeaType::DateRange\n        | SeaType::Enum(_) => DataType::Varchar,\n        SeaType::Line","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/postgres.rs#L678-L714","documentation":"When mapping a discovered SeaQL column type to a RisingWave DataType, `SeaType::Array` elements must carry their own `col_type`. If the element type descriptor is `None`, the connector cannot infer the array's element type and throws this error.","triggerScenarios":"`sea_type_to_rw_type` encountering an `Array` definition whose inner `col_type` is `None` — typically from schema discovery output that lacks nested element typing (e.g. unusual or nested array columns).","commonSituations":"Multi-dimensional arrays (e.g. `int[][]`) whose inner type is unresolvable; schema discovery returning partial type info for exotic array columns; older discovery output formats missing element types.","solutions":["Restructure the upstream column to a single-level array with a simple element type (RW supports one nesting level)","Cast the column to `text` upstream and parse it in RisingWave","Avoid unsupported array element types (e.g. arrays of arrays, arrays of records)"],"exampleFix":"-- before\nCREATE TABLE t (matrix INTEGER[][]);\n-- after\nCREATE TABLE t (values INTEGER[]);","handlingStrategy":"type-guard","validationCode":"fn is_supported_pg_column(sea_type: &SeaQlType) -> bool {\n    !matches!(sea_type, SeaType::Array(def) if def.col_type.is_none())\n}","typeGuard":"fn has_array_element_type(t: &SeaType) -> bool {\n    matches!(t, SeaType::Array(def) if def.col_type.is_some())\n}","tryCatchPattern":"let rw_type = sea_type_to_rw_type(&col.col_type).map_err(|e| {\n    if e.to_string().contains(\"ARRAY type missing element type\") {\n        TypeError::UnsupportedArray(col.name.clone())\n    } else { TypeError::Other(e) }\n})?;","preventionTips":["Keep upstream arrays single-level with concrete scalar element types","Avoid int[][]/text[][] style multi-dimensional arrays","Cast exotic columns to text upstream before CDC"],"tags":["postgres","array","type-mapping","unsupported-type"],"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"}