Skip to content

FFI: FFI_WindowUDF silently drops producer overrides of defaulted trait methods #22332

@timsaucer

Description

@timsaucer

Gap

FFI_WindowUDF in datafusion/ffi/src/udwf/mod.rs does not plumb several defaulted methods of WindowUDFImpl. Producer overrides are silently lost on the consumer side.

Missing methods

  • simplify
  • expressions
  • reverse_expr
  • documentation

Why it matters

Severity: important. expressions() selects which physical expressions reach the PartitionEvaluator — silent fallback can change window-function semantics. simplify and reverse_expr are planner hooks. documentation is cosmetic but cheap to add.

Implementation notes

  • Plumb each as a plain unsafe extern \"C\" fn; wrapper body calls the trait method on inner Arc<dyn WindowUDFImpl> and dispatch handles override-or-default.
  • expressions returns Vec<Arc<dyn PhysicalExpr>> — relies on the existing FFI_PhysicalExpr plumbing.
  • simplify / reverse_expr ship Expr — require the embedded FFI_LogicalExtensionCodec.
  • Layout change → api change label, target main only, no back-port to branch-<major>.
  • Add unit tests (local-bypass + mock_foreign_marker_id forced-foreign) and integration tests under datafusion/ffi/tests/.

Generated from an audit performed for PR #22327 (datafusion-ffi agent skill). If a PR addressing this finds any item to be a false positive (e.g., a method intentionally omitted for a documented reason), please also propose an update to the datafusion-ffi skill so future audits do not re-flag it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestffiChanges to the ffi cratefunctionsChanges to functions implementation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions