Round() function crashing mapd

Hi
SELECT sum(round(coalesce(subquery.“label_2020_cal_met_case”, 0), 0)) AS label_2020_cal_met_case1 FROM (SELECT case when table1.price = 10000 then 1 else 0 end as label_2020_cal_met_case FROM table1) AS subquery LIMIT 1001

the above query is running and it returns value as 0

SELECT round(sum(coalesce(subquery.“label_2020_cal_met_case”, 0)), 0) AS label_2020_cal_met_case1 FROM (SELECT case when table1.price = 10000 then 1 else 0 end as label_2020_cal_met_case FROM table1) AS subquery LIMIT 1001

but in this query i changes round function outside sum function its crashing mapd without any error how to solve this issue

i need to sum values and then round that value

First of all @nagulan, I want to welcome back to our forum.

I tried to reproduce the issue with no luck; as you can see I used a query that resemble the one you posted.

omnisql> select round(sum(coalesce(subquery.label_test,0)),0) from (select case when MercX between 5968719 and 8988719 then 1 else 0 end as label_test from adsb_airplanes_test) as subquery limit 1001;
EXPR$0
9533446
1 rows returned.
Execution time: 35 ms, Total time: 36 ms

I tried with FLOAT, DOUBLE, and DECIMAL(9,0) datatypes.

Could you post version, log extract with the crash error and DDL?

There is also a function called round_to_digit, that’s doing the same thing of the round. try to use it