You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "timsaucer (via GitHub)" <gi...@apache.org> on 2026/05/18 12:56:19 UTC
[I] FFI: `FFI_ScalarUDF` silently drops producer overrides of defaulted trait methods [datafusion]
timsaucer opened a new issue, #22330:
URL: https://github.com/apache/datafusion/issues/22330
## 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] FFI: `FFI_ScalarUDF` silently drops producer overrides of defaulted trait methods [datafusion]
Posted by "emecii (via GitHub)" <gi...@apache.org>.
emecii commented on issue #22330:
URL: https://github.com/apache/datafusion/issues/22330#issuecomment-5601601765
I’m working on the `ScalarUDFImpl::is_strict` slice only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] FFI: `FFI_ScalarUDF` silently drops producer overrides of defaulted trait methods [datafusion]
Posted by "emecii (via GitHub)" <gi...@apache.org>.
emecii commented on issue #22330:
URL: https://github.com/apache/datafusion/issues/22330#issuecomment-5613189078
I’m working on the `ScalarUDFImpl::evaluate_bounds` slice only.
AI-generated with Codex (GPT-5).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] FFI: `FFI_ScalarUDF` silently drops producer overrides of defaulted trait methods [datafusion]
Posted by "Amogh-2404 (via GitHub)" <gi...@apache.org>.
Amogh-2404 commented on issue #22330:
URL: https://github.com/apache/datafusion/issues/22330#issuecomment-5277087935
I'd like to take `ScalarUDFImpl::is_strict` as a small part of this issue. The method was added after this issue was opened, and `ForeignScalarUDF` currently falls back to `false` instead of forwarding the producer's value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] FFI: `FFI_ScalarUDF` silently drops producer overrides of defaulted trait methods [datafusion]
Posted by "Amogh-2404 (via GitHub)" <gi...@apache.org>.
Amogh-2404 commented on issue #22330:
URL: https://github.com/apache/datafusion/issues/22330#issuecomment-5386997085
I won't be proceeding with `is_strict`, so it is free for anyone to pick up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org