Skip to content

Add a forward-flexible property slot to the Comet UDF C ABI #5254

Description

@andygrove

Follow-up from review of #4459 (thread).

The C ABI today exposes exactly function_name, new_impl, init, execute, get_last_error and release. Anything else a kernel might want to tell the host, volatility, Display/Debug renderings, documentation, aliases, needs a new struct field and a COMET_UDF_ABI_VERSION bump, which breaks every existing cdylib.

@paleolimbot suggested a generic property getter instead, of the shape they are already using for table providers, exec plans and expressions:

pub get_property: Option<
    unsafe extern "C" fn(
        *mut CometCScalarKernelImpl,
        property: *const c_char,
        args: *const c_char,
        out: *mut FFI_ArrowArray,
    ) -> c_int,
>,

New properties then become new strings rather than new ABI, and an older cdylib answers "unsupported" for a property it does not know.

The awkward part, as noted in the thread, is returning a variable-length string: using an FFI_ArrowArray for it works and is what the suggestion does, but is arguably overkill.

Adding the field itself is an ABI change, so it wants to land before anyone depends on the current layout, or ride along with another version bump. Volatility (#5249) is the first concrete consumer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions