Arguments
On this page
Declaring a signature, and reading the values that arrive.
struct Arguments
Section titled “struct Arguments”pub struct Arguments { pub positional: Vec<Option<ArrayRef>>, pub named: HashMap<String, ArrayRef>, pub schema: Option<SchemaRef>, pub positional_fields: Vec<Option<Field>>,}Description
Parsed function arguments.
Methods
method arg
Section titled “method arg”pub fn arg(&self, pos: usize) -> Option<&ArrayRef>The 1-row array of the positional argument at pos, if present.
method arg_field
Section titled “method arg_field”pub fn arg_field(&self, pos: usize) -> Option<&Field>The original field (with metadata, e.g. extension names) of the
positional argument at pos, if present.
method const_bool
Section titled “method const_bool”pub fn const_bool(&self, pos: usize) -> Option<bool>Read a const bool.
method const_bytes
Section titled “method const_bytes”pub fn const_bytes(&self, pos: usize) -> Option<Vec<u8>>Read const binary bytes.
method const_f64
Section titled “method const_f64”pub fn const_f64(&self, pos: usize) -> Option<f64>Read a const float (any float/int widened to f64).
method const_i64
Section titled “method const_i64”pub fn const_i64(&self, pos: usize) -> Option<i64>Read a const int (any integer type widened to i64).
method const_str
Section titled “method const_str”pub fn const_str(&self, pos: usize) -> Option<String>Read a const string.
method named
Section titled “method named”pub fn named(&self, name: &str) -> Option<&ArrayRef>The 1-row array of a named argument (non-null), if present. Lets callers read types without a dedicated accessor (e.g. INTERVAL month_day_nano).
method named_bool
Section titled “method named_bool”pub fn named_bool(&self, name: &str) -> Option<bool>Read a named const bool argument.
method named_f64
Section titled “method named_f64”pub fn named_f64(&self, name: &str) -> Option<f64>Read a named const float argument.
method named_i64
Section titled “method named_i64”pub fn named_i64(&self, name: &str) -> Option<i64>Read a named const int argument.
method named_str
Section titled “method named_str”pub fn named_str(&self, name: &str) -> Option<String>Read a named const string argument.
method num_positional
Section titled “method num_positional”pub fn num_positional(&self) -> usizeNumber of positional arguments.
method parse
Section titled “method parse”pub fn parse(bytes: &[u8]) -> Result<Arguments>Parse the IPC-serialized arguments blob. Empty input → no arguments.
method remap_positional
Section titled “method remap_positional”pub fn remap_positional(&mut self, specs: &[crate::function::ArgSpec])Expand compacted const-only positional args to their declared positions DuckDB sends only the const values, indexed in send order; this maps them back onto the declared positions.
method serialize_positional
Section titled “method serialize_positional”pub fn serialize_positional(values: &[ArrayRef]) -> Result<Vec<u8>>Serialize positional const arguments into the wire arguments blob
(an IPC batch with a single args struct column whose fields are
positional_0, positional_1, …). Inverse of [Arguments::parse].
method serialize_scan_args
Section titled “method serialize_scan_args”pub fn serialize_scan_args(values: &[ArrayRef]) -> Result<Vec<u8>>Serialize positional scan arguments in the catalog ScanFunctionResult
format: a flat IPC batch with columns arg_0, arg_1, … (NOT the
args struct used for direct calls).
method serialize_scan_args_named
Section titled “method serialize_scan_args_named”pub fn serialize_scan_args_named( positional: &[ArrayRef], named: &[(&str, ArrayRef)],) -> Result<Vec<u8>>Serialize positional (arg_<i>) plus named (bare-name) scan arguments
into the flat ScanFunctionResult.arguments batch.
function resolve_overload
Section titled “function resolve_overload”pub fn resolve_overload<F>( count: usize, specs_of: F, args: &Arguments, input_schema: Option<&SchemaRef>,) -> Option<usize>where F: Fn(usize) -> Vec<ArgSpec>,Description
Resolve the best candidate index, or None if none are compatible.
function resolve_overload_blended
Section titled “function resolve_overload_blended”pub fn resolve_overload_blended<F, B>( count: usize, specs_of: F, blended_of: B, args: &Arguments, input_schema: Option<&SchemaRef>,) -> Option<usize>where F: Fn(usize) -> Vec<ArgSpec>, B: Fn(usize) -> bool,Description
[resolve_overload] with a per-candidate blended (input_from_args) flag.
A blended candidate’s positional args ARE the per-row input columns — they
are NOT on the wire (args.positional is empty in every call shape), so it
resolves by INPUT-COLUMN count against the declared positional arity
(geo_encode(52,13) → the 2-positional overload, geo_encode(52,13,100) →
the 3-positional one; varargs matches any input-column count >= the fixed
positional count) and disambiguates same-arity overloads by scoring the
declared positional types against the input schema’s column types.