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

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   
   add rpc avg udaf  sample 
   ```
   CREATE AGGREGATE FUNCTION  rpc_avg(int) RETURNS double PROPERTIES (
       "TYPE"="RPC",
       "OBJECT_FILE"="127.0.0.1:9000",
       "update_fn"="rpc_avg_update",
       "merge_fn"="rpc_avg_merge",
       "finalize_fn"="rpc_avg_finalize"
   );
   
   CREATE TABLE `table1` (
     `event_day` date NULL,
     `siteid` int(11) NULL DEFAULT "10",
     `citycode` smallint(6) NULL,
     `username` varchar(32) NULL DEFAULT "",
     `pv` bigint(20) SUM NULL DEFAULT "0"
   ) ENGINE=OLAP
   AGGREGATE KEY(`event_day`, `siteid`, `citycode`, `username`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`siteid`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   )
   ```
   import  100w rows data
   ## result
   
   
![image](https://user-images.githubusercontent.com/11487604/180424853-d8dfa11f-0736-440b-8e2b-c1d19635ec3d.png)
   
   The performance of calculating the mean value alone is similar to that of 
the built-in function
   
   
![image](https://user-images.githubusercontent.com/11487604/180424654-557cfd53-001f-40be-888f-a42891a04b41.png)
   Double the performance loss of the group by scenario
   
   
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   


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

Reply via email to