{"record":{"id":"7f01a6d8bbfb7397","repo":"risingwavelabs/risingwave","slug":"nested-array-type-is-not-supported","errorCode":null,"errorMessage":"nested array type is not supported","messagePattern":"nested array type is not supported","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/postgres.rs","lineNumber":827,"sourceCode":"                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),\n                SeaType::TimeWithTimeZone(_) => Ok(PgType::TIMETZ_ARRAY),\n                SeaType::Interval(_) => Ok(PgType::INTERVAL_ARRAY),\n                SeaType::Boolean => Ok(PgType::BOOL_ARRAY),\n                SeaType::Point => Ok(PgType::POINT_ARRAY),\n                SeaType::Uuid => Ok(PgType::UUID_ARRAY),\n                SeaType::Json => Ok(PgType::JSON_ARRAY),\n                SeaType::JsonBinary => Ok(PgType::JSONB_ARRAY),\n                SeaType::Array(_) => bail!(\"nested array type is not supported\"),\n                SeaType::Unknown(name) => {\n                    // Treat as enum type\n                    Ok(PgType::new(\n                        name.clone(),\n                        0,\n                        PgKind::Array(PgType::new(\n                            name.clone(),\n                            0,\n                            PgKind::Enum(vec![]),\n                            \"\".into(),\n                        )),\n                        \"\".into(),\n                    ))\n                }\n                _ => bail!(\"unsupported array type: {:?}\", t),\n            }\n        }\n        SeaType::Unknown(name) => {","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/postgres.rs#L809-L845","documentation":"When mapping a SeaQuery column type to a PostgreSQL type for the Postgres sink connector, array-of-array columns (e.g. INTEGER[][]) cannot be represented. The mapper explicitly rejects SeaType::Array wrapping another Array with this error because Postgres has no native multidimensional array wire type that this sink supports.","triggerScenarios":"Creating a RisingWave table/materialized view with a nested array column (array of arrays) and sinking it to a Postgres sink; the type_mapping step calls sea_type_to_pg_type and hits the SeaType::Array arm whose inner element is itself an array.","commonSituations":"Ingesting JSON or Protobuf data whose schema defines repeated/repeated fields (nested lists), or defining columns like INT[][] in RisingWave, then attempting a Postgres sink.","solutions":["Flatten the nested array into a single-level array before sinking (e.g. unnest and re-aggregate, or store as JSONB)","Change the column type to a supported type such as JSONB in the sink schema","Sink to a target other than Postgres, or use a custom sink handler that serializes nested arrays"],"exampleFix":"// before\nCREATE SINK s FROM mv WITH (connector='jdbc', ...); -- mv contains col INT[][]\n// after\nCREATE SINK s FROM (SELECT flatten_arr(col) AS col FROM mv) WITH (connector='jdbc', ...); -- col is INT[] or JSONB","handlingStrategy":"validation","validationCode":"fn is_nested_array(t: &ColumnDesc) -> bool {\n    matches!(t.data_type, DataType::List(inner) if matches!(&*inner, DataType::List(_)))\n}\n// before CREATE SINK: assert!(!is_nested_array(&col), \"flatten nested arrays before pg sink\");","typeGuard":"fn flatten_if_nested(v: Value) -> Value {\n    match v { Value::List(rows) if rows.iter().all(|r| matches!(r, Value::List(_))) => Value::Json, v => v }\n}","tryCatchPattern":null,"preventionTips":["Avoid arrays of arrays in schemas destined for Postgres sinks","Prefer JSONB columns for hierarchical/nested data","Review the sink type-mapping supported types list before schema design"],"tags":["postgres","sink","type-mapping","nested-array"],"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"}