pub struct FFI_QueryPlanner {
pub version: unsafe extern "C" fn() -> u64,
pub library_marker_id: extern "C" fn() -> usize,
/* private fields */
}Expand description
An ABI-stable handle to a QueryPlanner owned by another library.
The Rust-facing adapters serialize the input LogicalPlan and resulting
ExecutionPlan; callers do not invoke the byte-oriented function pointer
directly.
Fields§
§version: unsafe extern "C" fn() -> u64Return the major DataFusion version number of this planner.
library_marker_id: extern "C" fn() -> usizeUtility to identify when FFI objects are accessed locally through
the foreign interface. See crate::get_library_marker_id.
Implementations§
Source§impl FFI_QueryPlanner
impl FFI_QueryPlanner
Sourcepub fn new(
planner: Arc<dyn QueryPlanner + Send + Sync>,
runtime: Option<Handle>,
task_ctx_provider: impl Into<FFI_TaskContextProvider>,
logical_codec: Arc<dyn LogicalExtensionCodec>,
physical_codec: Arc<dyn PhysicalExtensionCodec>,
) -> Self
pub fn new( planner: Arc<dyn QueryPlanner + Send + Sync>, runtime: Option<Handle>, task_ctx_provider: impl Into<FFI_TaskContextProvider>, logical_codec: Arc<dyn LogicalExtensionCodec>, physical_codec: Arc<dyn PhysicalExtensionCodec>, ) -> Self
Creates an FFI_QueryPlanner with native extension codecs.
Both codecs are required so that the caller states which extension nodes
survive the boundary. Pass
DefaultLogicalExtensionCodec
and
DefaultPhysicalExtensionCodec
when no custom nodes are involved. runtime and task_ctx_provider
support codec callbacks across the FFI boundary.
Sourcepub fn new_with_ffi_codecs(
planner: Arc<dyn QueryPlanner + Send + Sync>,
logical_codec: FFI_LogicalExtensionCodec,
physical_codec: FFI_PhysicalExtensionCodec,
) -> Self
pub fn new_with_ffi_codecs( planner: Arc<dyn QueryPlanner + Send + Sync>, logical_codec: FFI_LogicalExtensionCodec, physical_codec: FFI_PhysicalExtensionCodec, ) -> Self
Creates an FFI_QueryPlanner using prebuilt FFI extension codecs.
If planner is already foreign, this re-exports its original FFI handle
rather than adding another wrapper layer. The handle still adopts the
codecs supplied here, so they are never silently discarded.
Sourcepub async fn create_physical_plan_with_session_runtime(
&self,
logical_plan: &LogicalPlan,
session: &dyn Session,
session_runtime: Option<Handle>,
) -> Result<Arc<dyn ExecutionPlan>>
pub async fn create_physical_plan_with_session_runtime( &self, logical_plan: &LogicalPlan, session: &dyn Session, session_runtime: Option<Handle>, ) -> Result<Arc<dyn ExecutionPlan>>
Creates a physical plan through this planner’s FFI interface.
This serializes logical_plan, exports session as an
FFI_SessionRef, invokes the planner’s owning library, and
deserializes its physical-plan response. session_runtime is attached
to the exported session for callbacks that need its Tokio runtime.
The QueryPlanner implementation for ForeignQueryPlanner cannot
obtain the session owner’s runtime from the trait API, so it calls this
method with None. Embedders that own the runtime and need session
callbacks to enter it must call this method directly with Some(handle).
Trait Implementations§
Source§impl Clone for FFI_QueryPlanner
impl Clone for FFI_QueryPlanner
Source§impl Debug for FFI_QueryPlanner
impl Debug for FFI_QueryPlanner
Source§impl Drop for FFI_QueryPlanner
impl Drop for FFI_QueryPlanner
Source§impl From<&FFI_QueryPlanner> for Arc<dyn QueryPlanner + Send + Sync>
impl From<&FFI_QueryPlanner> for Arc<dyn QueryPlanner + Send + Sync>
Source§fn from(planner: &FFI_QueryPlanner) -> Self
fn from(planner: &FFI_QueryPlanner) -> Self
impl Send for FFI_QueryPlanner
impl Sync for FFI_QueryPlanner
Auto Trait Implementations§
impl Freeze for FFI_QueryPlanner
impl RefUnwindSafe for FFI_QueryPlanner
impl Unpin for FFI_QueryPlanner
impl UnsafeUnpin for FFI_QueryPlanner
impl UnwindSafe for FFI_QueryPlanner
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more