kasakrisz commented on PR #5091: URL: https://github.com/apache/hive/pull/5091#issuecomment-2104451403
@okumin Thanks for the research and sharing the details of your results. I think these are the issues to solve: * as you mentioned: "I believe SUM should return NULL if all rows are evaluated as NULL" on both CBO and non-CBO path. Swapping these lines may help to solve this: https://github.com/apache/hive/blob/7950967eae9640fcc0aa22f4b6c7906b34281eac/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java#L443-L444 * Add an explicit cast in case the parameter of the aggregates mentioned has type from the character family to make sure that `count` only counts values which can be converted to a numeric type. Please add tests for `sum(c_non_numeric)` and `sum(c_mix)` if not exists. -- 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]
