Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
Hit this while investigating tpch data variation between postgres and drill
Simplified tpch14 to the following query:
select
sum(case
when l.L_RETURNFLAG like 'R%'
then l.l_extendedprice * (1 - l.l_discount)
else 0
end)
from lineitem l;
returns bigint in the case of drill and double in the case of postgres. Extendedprice and discount are double though.
Drill:507996494
Postgres:507996454.406699
However when the case is removed and we use an equivalent filter instead drill and postgres return the same results:
select
sum(l.l_extendedprice * (1 - l.l_discount)
from lineitem l where l.L_RETURNFLAG like 'R%';
Postgres: 507996454.406699
Drill: 5.0799645440669966E8
This would explain the data mismatch for both TPCH14 and 8
git.commit.id.abbrev=e5c2da0