You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "milenkovicm (via GitHub)" <gi...@apache.org> on 2023/09/26 15:09:52 UTC

[GitHub] [arrow-datafusion] milenkovicm opened a new issue, #7660: Ability to alter DataFrame plan adding LogicalPlan::Extension node

milenkovicm opened a new issue, #7660:
URL: https://github.com/apache/arrow-datafusion/issues/7660

   ### Is your feature request related to a problem or challenge?
   
   Most operations on `DataFrame` will modify current `LogicalPlan` crating new `DataFrame` as the result.
   At the moment I see no option to modify `df.plan` adding `LogicalPlan::Extension` node to it.
   
   ### Describe the solution you'd like
   
   The approach which IMHO makes sense would be to add additional trait `DataFrameExtend` which would expose a single function, roughly something similar to:
   
   ```rust
   pub trait DataFrameExtend {
     fn map_plan(MF: FnOnce(LogicalPlan) -> Result<LogicalPlan> > (self, map: MF) -> Result<DataFrame>
   }
   
   impl DataFrameExtend for DataFrame {
     fn map_plan(F: FnOnce(LogicalPlan) -> Result<LogicalPlan> > (self, map: F) -> Result<DataFrame> {
       let session_state = self.session_state;
       let new_plan = map(self.plan);
       Ok(DataFrame::new(session_state, plan))
     }
   }
   ```
   
   This way `DataFrame` API would not change, unless `DataFrameExtend` is included. 
   
   
   
   
   ### Describe alternatives you've considered
   
   Alternatives: 
   - expose `df.session_state` either making it public or adding a accessor method, let the users create new DataFrame themselfs
   - put `map_plan` to `DataFrame`, which will impact public api and expose method which is not needed in too many cases
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] milenkovicm closed issue #7660: Ability to alter DataFrame plan adding LogicalPlan::Extension node

Posted by "milenkovicm (via GitHub)" <gi...@apache.org>.
milenkovicm closed issue #7660: Ability to alter DataFrame plan adding LogicalPlan::Extension node
URL: https://github.com/apache/arrow-datafusion/issues/7660


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] milenkovicm commented on issue #7660: Ability to alter DataFrame plan adding LogicalPlan::Extension node

Posted by "milenkovicm (via GitHub)" <gi...@apache.org>.
milenkovicm commented on issue #7660:
URL: https://github.com/apache/arrow-datafusion/issues/7660#issuecomment-1737190939

   DataFrame provides `into_parts` which returns SessionState and LogicalPlan, no need for this change at the moment 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org