{"record":{"id":"7a27ffe4fa05a8bb","repo":"risingwavelabs/risingwave","slug":"unsupported-data-type","errorCode":null,"errorMessage":"unsupported data type: {:?}","messagePattern":"unsupported data type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/expr/impl/src/udf/wasm.rs","lineNumber":340,"sourceCode":"            DataType::Timestamp => \"timestamp\".to_owned(),\n            DataType::Timestamptz => \"timestamptz\".to_owned(),\n            DataType::Interval => \"interval\".to_owned(),\n            DataType::Decimal => \"decimal\".to_owned(),\n            DataType::Jsonb => \"json\".to_owned(),\n            DataType::Serial => \"serial\".to_owned(),\n            DataType::Int256 => \"int256\".to_owned(),\n            DataType::Bytea => \"binary\".to_owned(),\n            DataType::Varchar => \"string\".to_owned(),\n            DataType::List(l) => format!(\"{}[]\", datatype_name(l.elem())?),\n            DataType::Struct(s) => format!(\n                \"struct<{}>\",\n                s.iter()\n                    .map(|(name, ty)| datatype_name(ty)\n                        .map(|type_name| format!(\"{}:{}\", name, type_name)))\n                    .try_collect::<_, Vec<_>, _>()?\n                    .join(\",\")\n            ),\n            _ => anyhow::bail!(\"unsupported data type: {:?}\", ty),\n        };\n        Ok(name)\n    }\n\n    Ok(format!(\n        \"{}({}){}{}\",\n        name,\n        args.iter()\n            .map(datatype_name)\n            .try_collect::<_, Vec<_>, _>()?\n            .join(\",\"),\n        if table_function { \"->>\" } else { \"->\" },\n        datatype_name(ret)?\n    ))\n}\n","sourceCodeStart":322,"sourceCodeEnd":356,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/impl/src/udf/wasm.rs#L322-L356","documentation":"The WASM UDF name/serialization path builds a type signature string by mapping each argument DataType to a name via `datatype_name`. When it encounters a DataType variant with no name mapping, it bails with `unsupported data type`. This guards the UDF function-name encoding which must be deterministic and storable in the catalog.","triggerScenarios":"Calling `datatype_name` (used while generating the WASM UDF's function name string) with a DataType such as Struct, Map, Bytea, or other variants not covered by the match in src/expr/impl/src/udf/wasm.rs:340.","commonSituations":"Declaring a WASM UDF whose signature includes struct, map, or other composite types that the UDF runtime does not support for name encoding; upgrading RisingWave and adding new column types to a UDF signature.","solutions":["Change the UDF signature to only use supported primitive types (int, bigint, varchar, boolean, float64, date, timestamp, etc.)","Check the `datatype_name` match and add a mapping for the offending DataType if it should be supported","Fall back to Debug formatting of the DataType instead of failing if a lossy name is acceptable"],"exampleFix":"// before\n_ => anyhow::bail!(\"unsupported data type: {:?}\", ty),\n// after\n_ => Ok(format!(\"{:?}\", ty)), // accept any type via debug name","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\"boolean\",\"int16\",\"int32\",\"int64\",\"float32\",\"float64\",\"varchar\",\"date\",\"timestamp\",\"timestamptz\",\"interval\"];\nfn validate_udf_args(args: &[risingwave_common::DataType]) -> Result<(), String> {\n    args.iter().map(|t| format!(\"{:?}\", t)).try_for_each(|n| if SUPPORTED.contains(&n.as_str()) { Ok(()) } else { Err(format!(\"unsupported type for wasm udf: {n}\")) })\n}","typeGuard":"fn is_supported_wasm_type(t: &DataType) -> bool { !matches!(t, DataType::Struct(_) | DataType::Map(_) | DataType::Bytea) }","tryCatchPattern":null,"preventionTips":["Restrict WASM UDF signatures to primitive types","Add a unit test invoking the UDF with every declared argument type","Keep datatype_name mappings in sync when adding DataType variants"],"tags":["udf","wasm","unsupported-dtype"],"backgroundTag":"unsupported-dtype","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}