risingwavelabs/risingwave · error

unsupported data type

Error message

unsupported data type: {:?}

What it means

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.

Solutions

  1. Change the UDF signature to only use supported primitive types (int, bigint, varchar, boolean, float64, date, timestamp, etc.)
  2. Check the `datatype_name` match and add a mapping for the offending DataType if it should be supported
  3. Fall back to Debug formatting of the DataType instead of failing if a lossy name is acceptable

Example fix

// before
_ => anyhow::bail!("unsupported data type: {:?}", ty),
// after
_ => Ok(format!("{:?}", ty)), // accept any type via debug name
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: &[&str] = &["boolean","int16","int32","int64","float32","float64","varchar","date","timestamp","timestamptz","interval"];
fn validate_udf_args(args: &[risingwave_common::DataType]) -> Result<(), String> {
    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}")) })
}

Type guard

fn is_supported_wasm_type(t: &DataType) -> bool { !matches!(t, DataType::Struct(_) | DataType::Map(_) | DataType::Bytea) }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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

Appendix: source

Thrown at src/expr/impl/src/udf/wasm.rs:340

            DataType::Timestamp => "timestamp".to_owned(),
            DataType::Timestamptz => "timestamptz".to_owned(),
            DataType::Interval => "interval".to_owned(),
            DataType::Decimal => "decimal".to_owned(),
            DataType::Jsonb => "json".to_owned(),
            DataType::Serial => "serial".to_owned(),
            DataType::Int256 => "int256".to_owned(),
            DataType::Bytea => "binary".to_owned(),
            DataType::Varchar => "string".to_owned(),
            DataType::List(l) => format!("{}[]", datatype_name(l.elem())?),
            DataType::Struct(s) => format!(
                "struct<{}>",
                s.iter()
                    .map(|(name, ty)| datatype_name(ty)
                        .map(|type_name| format!("{}:{}", name, type_name)))
                    .try_collect::<_, Vec<_>, _>()?
                    .join(",")
            ),
            _ => anyhow::bail!("unsupported data type: {:?}", ty),
        };
        Ok(name)
    }

    Ok(format!(
        "{}({}){}{}",
        name,
        args.iter()
            .map(datatype_name)
            .try_collect::<_, Vec<_>, _>()?
            .join(","),
        if table_function { "->>" } else { "->" },
        datatype_name(ret)?
    ))
}

View on GitHub (pinned to 6469eb736d)