timsaucer opened a new issue, #22328:
URL: https://github.com/apache/datafusion/issues/22328

   ## 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.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to