NoahKusaba commented on code in PR #2389:
URL:
https://github.com/apache/datafusion-ballista/pull/2389#discussion_r3877642255
##########
ballista/core/src/serde/mod.rs:
##########
@@ -188,14 +188,117 @@ impl<T: 'static + AsLogicalPlan, U: 'static +
AsExecutionPlan> BallistaCodec<T,
}
}
+/// Serialization seam for table providers owned by external data sources.
+pub trait BallistaTableProviderCodec: Debug + Send + Sync {
+ /// Stable wire name used to select this codec during decoding.
+ fn name(&self) -> &str;
+
+ /// Encodes a table provider when this codec owns it.
+ fn try_encode_table_provider(
+ &self,
+ table_ref: &datafusion::common::TableReference,
+ provider: Arc<dyn datafusion::catalog::TableProvider>,
+ ) -> Result<Option<Vec<u8>>>;
+
+ /// Rebuilds a table provider from this codec's payload.
+ fn decode_table_provider(
+ &self,
+ payload: &[u8],
+ table_ref: &datafusion::common::TableReference,
+ schema: SchemaRef,
+ ctx: &TaskContext,
+ ) -> Result<Arc<dyn datafusion::catalog::TableProvider>>;
+}
+
+/// Serialization seam for execution plans owned by external data sources.
+pub trait BallistaPhysicalPlanCodec: Debug + Send + Sync {
+ /// Stable wire name used to select this codec during decoding.
+ fn name(&self) -> &str;
+
+ /// Encodes an execution plan when this codec owns it.
+ fn try_encode_plan(
+ &self,
+ plan: Arc<dyn ExecutionPlan>,
+ proto_converter: &dyn PhysicalProtoConverterExtension,
+ ) -> Result<Option<Vec<u8>>>;
+
+ /// Rebuilds an execution plan from this codec's payload.
+ fn decode_plan(
+ &self,
+ payload: &[u8],
+ inputs: &[Arc<dyn ExecutionPlan>],
+ ctx: &TaskContext,
+ proto_converter: &dyn PhysicalProtoConverterExtension,
+ ) -> Result<Arc<dyn ExecutionPlan>>;
+}
+
+const DATA_SOURCE_CODEC_PREFIX: &[u8] = b"ballista-data-source-v1\0";
Review Comment:
?
--
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]