pub struct PythonLogicalCodec { /* private fields */ }Expand description
LogicalExtensionCodec parked on every SessionContext. Holds
the Python-aware encoding hooks for logical-layer types
(LogicalPlan, Expr) and delegates everything it does not
handle to the composable inner codec — typically
DefaultLogicalExtensionCodec, or a downstream FFI codec
installed via SessionContext.with_logical_extension_codec(...).
Sitting at the top of the session’s logical codec stack means
every serializer that reads session.logical_codec() automatically
picks up Python-aware encoding for free.
Implementations§
Source§impl PythonLogicalCodec
impl PythonLogicalCodec
pub fn new(inner: Arc<dyn LogicalExtensionCodec>) -> Self
pub fn inner(&self) -> &Arc<dyn LogicalExtensionCodec> ⓘ
Sourcepub fn with_python_udf_inlining(self, enabled: bool) -> Self
pub fn with_python_udf_inlining(self, enabled: bool) -> Self
Toggle inline encoding of Python UDFs. See
SessionContext.with_python_udf_inlining (Python) for full
behavior and use cases.
Security scope: strict mode (false) narrows only the codec
layer — it stops Expr::from_bytes from invoking
cloudpickle.loads on the inline DFPY* payload. It does
not make pickle.loads(untrusted_bytes) safe; treat every
pickle.loads on untrusted input as unsafe regardless of this
setting. See docs/source/user-guide/io/distributing_work.rst
(Security section) for the full threat model, and Python’s
pickle module security warning for why pickle.loads is
unsafe in general.
pub fn python_udf_inlining(&self) -> bool
Trait Implementations§
Source§impl Debug for PythonLogicalCodec
impl Debug for PythonLogicalCodec
Source§impl Default for PythonLogicalCodec
impl Default for PythonLogicalCodec
Source§impl LogicalExtensionCodec for PythonLogicalCodec
impl LogicalExtensionCodec for PythonLogicalCodec
fn try_decode( &self, buf: &[u8], inputs: &[LogicalPlan], ctx: &TaskContext, ) -> Result<Extension>
fn try_encode(&self, node: &Extension, buf: &mut Vec<u8>) -> Result<()>
fn try_decode_table_provider( &self, buf: &[u8], table_ref: &TableReference, schema: SchemaRef, ctx: &TaskContext, ) -> Result<Arc<dyn TableProvider>>
fn try_encode_table_provider( &self, table_ref: &TableReference, node: Arc<dyn TableProvider>, buf: &mut Vec<u8>, ) -> Result<()>
fn try_decode_file_format( &self, buf: &[u8], ctx: &TaskContext, ) -> Result<Arc<dyn FileFormatFactory>>
fn try_encode_file_format( &self, buf: &mut Vec<u8>, node: Arc<dyn FileFormatFactory>, ) -> Result<()>
fn try_encode_udf(&self, node: &ScalarUDF, buf: &mut Vec<u8>) -> Result<()>
fn try_decode_udf(&self, name: &str, buf: &[u8]) -> Result<Arc<ScalarUDF>>
fn try_encode_udaf(&self, node: &AggregateUDF, buf: &mut Vec<u8>) -> Result<()>
fn try_decode_udaf(&self, name: &str, buf: &[u8]) -> Result<Arc<AggregateUDF>>
fn try_encode_udwf(&self, node: &WindowUDF, buf: &mut Vec<u8>) -> Result<()>
fn try_decode_udwf(&self, name: &str, buf: &[u8]) -> Result<Arc<WindowUDF>>
fn try_decode_higher_order_function( &self, name: &str, _buf: &[u8], ) -> Result<Arc<HigherOrderUDF>, DataFusionError>
fn try_encode_higher_order_function( &self, _node: &HigherOrderUDF, _buf: &mut Vec<u8>, ) -> Result<(), DataFusionError>
Auto Trait Implementations§
impl !RefUnwindSafe for PythonLogicalCodec
impl !UnwindSafe for PythonLogicalCodec
impl Freeze for PythonLogicalCodec
impl Send for PythonLogicalCodec
impl Sync for PythonLogicalCodec
impl Unpin for PythonLogicalCodec
impl UnsafeUnpin for PythonLogicalCodec
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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