ROUND function not working as expected

Have a little confusion about the round function,
when apply it against decimal type,
it seems not working correctly, the digits all become zeros,
as example show below:

Before round

After round


@zhaoxixiang For MySQL, the ROUND function would be pushed down to mySQL, can you send us the profile to see what is getting push down?

Sure. @balaji.ramaswamy (13.7 KB)

@zhaoxixiang Dremio is pushing the below SQL to MySQL, can you run this on MySQL and see what happens?

SELECT CAST(ROUND(`t_xs_stock`.`meter_weight`, 3) AS SIGNED) AS `EXPR$0`
FROM `scp_sale`.`t_xs_stock`

@balaji.ramaswamy records result is 0 , maybe CAST is the problem?

@zhaoxixiang Does below return the right value?

SELECT ROUND(`t_xs_stock`.`meter_weight`, 3)  AS `EXPR$0`
FROM `scp_sale`.`t_xs_stock`

@balaji.ramaswamy Yes, it round correctly.

@zhaoxixiang That does look like a push down issue, I wil try to reproduce this, as a workaround are you able to use EXTERNAL QUERY?

Not really able to do that at the moment, looking forward to you guys fixing that, Thanks again!