alexthe2 opened a new issue, #18266:
URL: https://github.com/apache/datafusion/issues/18266

   ### Describe the bug
   
   The current approach allows to create a Rel plan of the proto kind, but then 
to create the actual `prost::plan` it requires the `RelRoot` which requires 
names, which are currently constructed in the DefaultImpl via 
[`to_substrait_named_struct`](https://github.com/apache/datafusion/blob/22c4214fe1ca3953932f3f12ccd5b68dbfbefdf3/datafusion/substrait/src/logical_plan/producer/types.rs#L349).
   
   ### To Reproduce
   
   example code for a producer inspired by 
[`to_substrait_plan`](https://github.com/apache/datafusion/blob/22c4214fe1ca3953932f3f12ccd5b68dbfbefdf3/datafusion/substrait/src/logical_plan/producer/plan.rs#L27):
   ```rust
   
       pub fn to_plan(mut self, plan: LogicalPlan) -> 
anyhow::Result<Box<proto::Plan>> {
           let transformed_plan = self.handle_plan(&plan)?;
   
           let relations = vec![PlanRel {
               rel_type: Some(plan_rel::RelType::Root(RelRoot {
                   input: Some(*transformed_plan),
                   names: producer::to_substrait_named_struct(&mut self, 
plan.schema())?.names,
               })),
           }];
   
           Ok(Box::new(proto::Plan {
               version: Some(version::version_with_producer("daedalus")),
               extension_uris: vec![],
               extensions: self.extensions.into(),
               relations,
               advanced_extensions: None,
               expected_type_urls: vec![],
               parameter_bindings: vec![],
           }))
       }
   ```
   
   ### Expected behavior
   
   `to_substrait_named_struct` can just become public?
   
   ### Additional context
   
   in my opinion this is a bug, since it prevents the use of custom substrait 
to pass down to another execution engine


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