gabotechs commented on code in PR #23622:
URL: https://github.com/apache/datafusion/pull/23622#discussion_r3595884271
##########
datafusion/core/src/physical_planner.rs:
##########
@@ -143,6 +143,35 @@ pub trait PhysicalPlanner: Send + Sync {
) -> Result<Arc<dyn PhysicalExpr>>;
}
+/// A planner adapter that lowers expressions with the properties for the plan
+/// currently being built rather than the properties stored on the session.
+struct PhysicalPlannerWithProps<'a> {
+ inner: &'a dyn PhysicalPlanner,
+ execution_props: &'a ExecutionProps,
+}
+
+#[async_trait]
+impl PhysicalPlanner for PhysicalPlannerWithProps<'_> {
+ async fn create_physical_plan(
+ &self,
+ logical_plan: &LogicalPlan,
+ session_state: &SessionState,
+ ) -> Result<Arc<dyn ExecutionPlan>> {
+ self.inner
+ .create_physical_plan(logical_plan, session_state)
+ .await
+ }
+
+ fn create_physical_expr(
+ &self,
+ expr: &Expr,
+ input_dfschema: &DFSchema,
+ _session_state: &SessionState,
+ ) -> Result<Arc<dyn PhysicalExpr>> {
+ create_physical_expr(expr, input_dfschema, self.execution_props)
+ }
Review Comment:
🤔 I didn't realize we'd also need this. This starts to feel a bit more
hacky...
--
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]