Gap
FFI_ScalarUDF in datafusion/ffi/src/udf/mod.rs does not plumb several defaulted methods of ScalarUDFImpl. Producer overrides are silently lost on the consumer side.
Missing methods
display_name
schema_name
with_updated_config
simplify
preimage
conditional_arguments
evaluate_bounds
propagate_constraints
struct_field_mapping
output_ordering
preserves_lex_ordering
placement
documentation
Why it matters
Severity: critical. simplify / preimage / evaluate_bounds / propagate_constraints are optimizer hooks — silent loss disables rewrites and interval reasoning across the FFI boundary. display_name / schema_name produce wrong SQL output naming on the consumer side. placement / conditional_arguments affect planning correctness for short-circuiting and column placement.
Implementation notes
- Plumb each as a plain
unsafe extern \"C\" fn; wrapper body calls the trait method on inner Arc<dyn ScalarUDFImpl> and dispatch handles override-or-default.
- Methods that ship
Expr (e.g. simplify, preimage) require the embedded FFI_LogicalExtensionCodec for serialization.
- 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/ for any method shipping non-trivial FFI types.
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.
Gap
FFI_ScalarUDFindatafusion/ffi/src/udf/mod.rsdoes not plumb several defaulted methods ofScalarUDFImpl. Producer overrides are silently lost on the consumer side.Missing methods
display_nameschema_namewith_updated_configsimplifypreimageconditional_argumentsevaluate_boundspropagate_constraintsstruct_field_mappingoutput_orderingpreserves_lex_orderingplacementdocumentationWhy it matters
Severity: critical.
simplify/preimage/evaluate_bounds/propagate_constraintsare optimizer hooks — silent loss disables rewrites and interval reasoning across the FFI boundary.display_name/schema_nameproduce wrong SQL output naming on the consumer side.placement/conditional_argumentsaffect planning correctness for short-circuiting and column placement.Implementation notes
unsafe extern \"C\" fn; wrapper body calls the trait method on innerArc<dyn ScalarUDFImpl>and dispatch handles override-or-default.Expr(e.g.simplify,preimage) require the embeddedFFI_LogicalExtensionCodecfor serialization.api changelabel, targetmainonly, no back-port tobranch-<major>.mock_foreign_marker_idforced-foreign) and integration tests underdatafusion/ffi/tests/for any method shipping non-trivial FFI types.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-ffiskill so future audits do not re-flag it.