thinkharderdev commented on pull request #1677:
URL: 
https://github.com/apache/arrow-datafusion/pull/1677#issuecomment-1022593108


   > What if we changed the signature to something like the following (where 
the inputs are already provided)?
   > 
   > ```rust
   > /// Describes something that knows how to serialize / deserialize the
   > /// contents of DataFusion user defined extension points
   > pub trait ExtensionSerializer {
   > 
   >     /// Serializes a [UserDefinedLogicalNode] into an opaque set of
   >     /// bytes for transport over the network
   >     fn serialize_extension_node(node: &dyn UserDefinedLogicalNode, inputs: 
Vec<LogicalNode>) -> Result<Bytes, BallistaError>;
   > 
   >     //....
   > }
   > ```
   
   Something like that could work. You might package it up in something like:
   ```
   message ExtensionNode {
     bytes extension = 1;
     repeated bytes inputs = 2;
   }
   ```
   to allow you to pull the same trick on the decoding side. 
   
   I think this could be complementary to the approach in this PR. We could 
change the signature for `AsLogicalPlan` to:
   
   ```
        fn try_into_logical_plan(
           &self,
           ctx: &ExecutionContext,
           extension_serde: Option<Arc<dyn ExtensionSerializer>>
       ) -> Result<LogicalPlan, BallistaError>;
   ```


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


Reply via email to