Nithurshen commented on PR #19305:
URL: https://github.com/apache/datafusion/pull/19305#issuecomment-3651318935

   Thank you for the feedback!
   
   **Re: Missing Tests** I double-checked and the tests are included in 
`datafusion/ffi/src/session/mod.rs`. They might be hidden in the diff because 
the file is large, but they extend `test_ffi_session` to verify the props are 
carried over.
   
   **Re: Struct Implementation & ABI Safety** You are right. I implemented this 
using an opaque pointer cast, which assumes the consumer is also Rust and 
sharing the same ABI (essentially a local bypass).
   
   To fix this, I plan to refactor `FFI_ExecutionProps` to follow the 
`FFI_SessionConfig` pattern:
   
   Keep the internal `private_data`.
   
   Expose extern "C" accessor functions to retrieve the individual fields (like 
`query_execution_start_time`) as stable types.
   
   Have `ForeignSession` reconstruct the `ExecutionProps` from these values 
instead of casting the pointer.
   
   Also, `RuntimeEnv` is trickier because it contains shared resources (like 
`MemoryPool`) that cannot be easily serialized/reconstructed. Recreating it 
would mean the foreign session has a different memory pool than the host, which 
defeats the purpose.
   
   Do we currently have a pattern for sharing the `Arc<RuntimeEnv>` safely 
across FFI, or should I drop `runtime_env` from this PR and focus only on 
`execution_props` for now?


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