Skip to content

Expose ExecutionPlan statistics across the FFI boundary #22152

@mailmindlin

Description

@mailmindlin

Is your feature request related to a problem or challenge?

ExecutionPlan::partition_statistics() is not currently reachable through datafusion-ffi: FFI_ExecutionPlan exposes most of the trait (properties, children, with_new_children, name, execute, repartitioned, and soon metrics) but has no function pointer for partition_statistics(), so ForeignExecutionPlan::partition_statistics() falls through to the trait default implementation and always returns Statistics::new_unknown().

Describe the solution you'd like

Expose partition_statistics() across the FFI boundary by serializing the Statistics struct using protobuf, similar to how filters are currently handled. This avoids creating a parallel type system.

Describe alternatives you've considered

Create a mapping/conversion layer from the current Statistics type to FFI-safe types. Rejected: it requires defining many type variants and protobuf serialization results in much less code.

Additional context

I have a PR already authored.

This will be a breaking change requiring a major version bump.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions