czzmmc commented on issue #18343: URL: https://github.com/apache/doris/issues/18343#issuecomment-1495445559
Of course. Image we have a table named t_salary for employees' salary management. And we only have two members. Like blow. t_salary ``` Alice 100 Bob 200 ``` And now we have a Java UDF "cal_bonus" to calculate bonus for them. Here comes our way. The manager wanna set a number depending on how they behave during last year. So for this particular example, the manager would give Alice 300, and Bob 200. Now, our Java UDAF cal_bonus must take two parameters a rule and a salary column. Like cal_bonus(rule, salary). SQL: select name, cal_bonus('{"Alice": 300, "Bob":200}', salary) from t_salary; RESP: ``` name cal_bonus Alice 400 Bob 400 ``` The next year, we could continue to use this Java UDAF with different rule, when we hire more employees. -- 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