by-design 的行为, avg 就是 sum / count, flink 目前行为是根据入参类型来推断返回类型 (与 `sum` 以及 `/`
保持一致), 想要保持高精度,可以考虑把入参 cast 成 double.

On Mon, Sep 27, 2021 at 2:30 PM Asahi Lee <978466...@qq.com.invalid> wrote:

> hi!&nbsp; &nbsp; &nbsp; 我使用flink 1.13.2版本,在对 int 类型的字段通过avg函数求平均值时,其返回值类型为
> int ,而不是 double,decimal等浮点类型,导致计算值的精度丢失,请问这是bug吗?

回复