Gap
FFI_TableProvider in datafusion/ffi/src/table_provider.rs does not plumb several defaulted methods of TableProvider. When a producer overrides one of these, the consumer-side ForeignTableProvider falls back to the trait default, silently losing the override.
Missing methods
constraints
get_table_definition
get_logical_plan
get_column_default
scan_with_args
statistics
delete_from
update
truncate
Why it matters
Severity: critical. The three DML methods (delete_from, update, truncate) silently demote a writable foreign table to read-only. statistics and constraints break cost-based optimization. get_logical_plan / get_table_definition / get_column_default break view + DDL features.
Implementation notes
- Per the FFI skill: plumb every defaulted method as a plain
unsafe extern \"C\" fn. The wrapper body calls inner.method(...) and Arc<dyn TableProvider> dynamic dispatch picks override-or-default for free. Do not use Option<fn> unless there is a corresponding constructor capability flag.
- This is an
FFI_X struct layout change. PR must:
- Carry the
api change label.
- Target
main only — not back-portable to branch-<major>.
- Add unit tests (local-bypass + forced-foreign via
mock_foreign_marker_id).
- Add integration tests under
datafusion/ffi/tests/ exercising the new methods through the cdylib (cargo test -p datafusion-ffi --features integration-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.
Gap
FFI_TableProviderindatafusion/ffi/src/table_provider.rsdoes not plumb several defaulted methods ofTableProvider. When a producer overrides one of these, the consumer-sideForeignTableProviderfalls back to the trait default, silently losing the override.Missing methods
constraintsget_table_definitionget_logical_planget_column_defaultscan_with_argsstatisticsdelete_fromupdatetruncateWhy it matters
Severity: critical. The three DML methods (
delete_from,update,truncate) silently demote a writable foreign table to read-only.statisticsandconstraintsbreak cost-based optimization.get_logical_plan/get_table_definition/get_column_defaultbreak view + DDL features.Implementation notes
unsafe extern \"C\" fn. The wrapper body callsinner.method(...)andArc<dyn TableProvider>dynamic dispatch picks override-or-default for free. Do not useOption<fn>unless there is a corresponding constructor capability flag.FFI_Xstruct layout change. PR must:api changelabel.mainonly — not back-portable tobranch-<major>.mock_foreign_marker_id).datafusion/ffi/tests/exercising the new methods through the cdylib (cargo test -p datafusion-ffi --features integration-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-ffiskill so future audits do not re-flag it.