Skip to main content

run_table_func

Function run_table_func 

Source
pub fn run_table_func<Row: TableRow>(
    init_data: &TableInitData<Row>,
    output: &mut DataChunkHandle,
) -> UdfResult<()>
Expand description

Pulls up to output.capacity() rows from init_data’s iterator and writes them into output, then sets output’s row count. Exhaustion is signalled by writing fewer rows than the capacity (including zero), which is what DataChunkHandle::set_len communicates to DuckDB either way.

This is the body of every #[duckdb_table_function]-generated VTab::func; factoring it out here keeps generated code small.

§Errors

Returns an error if a row cannot be written.