jayzhan211 commented on issue #10074:
URL: https://github.com/apache/datafusion/issues/10074#issuecomment-2088374083

   @alamb I try the idea in #10327 and it seems promising!
   
   I would like to split the large #10327 into several ones for easier review, 
before that I would like to know your thought about the design and the 
dependency in the above graph, does it looks good?
   
   My thought about categorize those crate
   `expr-common`:  Things other than `Expr` and `LogicalPlan` can place it here
   `expr`: Mainly for `Expr` and `LogicalPlan`. Import 
`functions-aggregate-common` for UDAF.
   `physical-common`:  Physical expr trait or other common things. 
   `functions-aggregate-common`: Import `physical-common` and `expr-common`, 
for other users to build their own udaf.
   `functions-aggregate`:  datafusion builtin functions
   
   
   With `functions-aggregate-common`, we finally can have `physical-expr` as 
returns value in AggregateUDFImpl.
   
   ```rust
   pub trait AggregateUDFImpl: Debug + Send + Sync {
       fn reverse_expr(&self) -> Option<Arc<dyn AggregateExpr>> {
           None
       }
   }
   
   And, we import `functions-aggregate-common` to `expr`, we can have our new 
`AggregateUDF` in logical layer but user defined physical-expr interaction!
   
   ```rust
   pub enum AggregateFunctionDefinition {
       BuiltIn(aggregate_function::AggregateFunction),
       /// Resolved to a user defined aggregate function
       UDF(Arc<function::AggregateUDF>),
       /// A aggregation function constructed with name. This variant can not 
be executed directly
       /// and instead must be resolved to one of the other variants prior to 
physical planning.
       Name(Arc<str>),
   }
   ```
   
   


-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to