924060929 opened a new pull request, #12481:
URL: https://github.com/apache/doris/pull/12481

   # Proposed changes
   
   Support function registry.
   
   The classes:
   - FunctionRegistry: used to register scalar functions and aggregate functions
   - FunctionBuilder: used to resolve a BoundFunction, extract the constructor, 
and build to a BoundFunction by arguments(`List<Expression>`)
   
   Register example:
   ```java
   public class FunctionRegistry {
       public static final List<ScalarFunc> SCALAR_FUNCTIONS = ImmutableList.of(
               scalar(Substring.class, "substr", "substring"),
               scalar(WeekOfYear.class),
               scalar(Year.class)
       );
   
       public static final ImmutableList<AggregateFunc> AGGREGATE_FUNCTIONS = 
ImmutableList.of(
               agg(Avg.class),
               agg(Count.class),
               agg(Max.class),
               agg(Min.class),
               agg(Sum.class)
       );
   }
   ```
   
   Note:
   - Currently, we only support register scalar functions add aggregate 
functions, we will support register table functions.
   - Currently, we only support resolve function by function name and 
difference arity, but can not resolve the same arity override function, e.g. 
`some_function(Expression)` and `some_function(Literal)`
   
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [x] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [x] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [x] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [x] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [x] No


-- 
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: commits-unsubscr...@doris.apache.org

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


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

Reply via email to