alamb commented on issue #9558:
URL: 
https://github.com/apache/arrow-datafusion/issues/9558#issuecomment-2015193954

   I think adding a `name()` function to ExecutionPlan sounds like a good idea 
to me
   
   Requiring a `&static str` would likely be inconvenient for some use cases, 
but given the API doesn't currently exist I think it would be fine if you 
wanted to add it.
   
   Note I think you could probably just add a single function and make the 
change to the trait backwards compatible, for example 
   
   ```rust
   pub trait ExecutionPlan: Debug + DisplayAs + Send + Sync {
       /// return the name of this execution plan's type
       fn name(&self) -> &'static str { "UNKNOWN" }
   ...
   }
   ```
   
   The `UserDefinedLogicalNode` has a `fn name(&self) -> &str`: 
https://docs.rs/datafusion/latest/datafusion/logical_expr/trait.UserDefinedLogicalNode.html#tymethod.name
   Which is another possiblity
   
   Another option for an API that avoids string copying could be
   
   ```rust
   fn name(&self) -> Arc<str> ;
   ```
   
   To still allow dynamicc names


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