risingwavelabs/risingwave · error
USING is not supported for rust function
Error message
USING is not supported for rust function
What it means
Rust UDFs are registered by source code (compiled/embedded), not by fetching a binary, so the USING clause (LINK or base64 binary) is invalid for them. `create_rust` rejects any attempt to pass USING options.
Solutions
- Remove the USING clause from the rust UDF CREATE FUNCTION statement
- If you need a binary/link-based function, register it as a WASM UDF instead (`AS wasm USING LINK ...`)
- Provide the rust source with AS and the return type as required for rust UDFs
Example fix
-- before
CREATE FUNCTION f(INT) RETURNS INT LANGUAGE rust AS 'fn f(x: i32) -> i32 { x }' USING LINK 'http://x/f.wasm';
-- after
CREATE FUNCTION f(INT) RETURNS INT LANGUAGE rust AS 'fn f(x: i32) -> i32 { x }'; Defensive patterns
Strategy: validation
Validate before calling
if (language === 'rust' && sql.includes('USING')) throw new Error('USING is not supported for rust function'); Try / catch
try { await rw.query(createFunctionSql) } catch (e) { if (String(e).includes('USING is not supported for rust')) { /* strip USING and retry */ } else throw e; } Prevention
- Never reuse wasm DDL templates for rust UDFs
- Validate USING only appears with AS wasm
- Lint generated DDL per language type
When it happens
Trigger: `CREATE FUNCTION ... AS <rust source> ... USING LINK '...'` — `create_rust` sees `opts.using_link.is_some()`.
Common situations: Copy-pasting a WASM UDF DDL template (which requires USING) for a rust UDF; mixing rust and wasm registration syntax.
Related errors
- {0}
- aggregate function is not supported
- multiple UDF implementations found for language
- UDF aggregate has rows, but expected exactly 1
- UDF returned a value of type
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/62e3c33c3eef0935.
Report an issue: GitHub.
Appendix: source
Thrown at src/expr/impl/src/udf/wasm.rs:92
// test if the function exists in the wasm binary
_ = runtime.find_table_function(&name_in_runtime, arg_types, return_type)?;
}
UdfKind::Aggregate => {
todo!("wasm udaf");
}
}
let compressed_binary = Some(zstd::stream::encode_all(&*wasm_binary, 0)?);
Ok(CreateFunctionOutput {
name_in_runtime,
body: None,
compressed_binary,
})
}
fn create_rust(opts: CreateOptions<'_>) -> Result<CreateFunctionOutput> {
if opts.using_link.is_some() {
bail!("USING is not supported for rust function");
}
let name_in_runtime = opts.name.to_owned();
let prelude = "use arrow_udf::{{function, types::*}};";
let export_macro = if opts
.arg_types
.iter()
.chain(std::iter::once(opts.return_type))
.all(|t| !t.is_struct())
{
let identifier_v1 = wasm_identifier_v1(
&name_in_runtime,
opts.arg_types,
opts.return_type,
opts.kind.is_table(),
)?;
format!("#[function(\"{}\")]", identifier_v1)
} else {View on GitHub (pinned to 6469eb736d)