hyper-api-samples
hyper-api-samples copied to clipboard
wrong result when multiply by a calculus
I have a problem on the query 11 on the TPCH(SF10). It seams Hyper does not return the correct result set. By digging into the issue I found something strange : These Query that is part on the having filter part of the TPCH Q11 return 0
SELECT
SUM("PS_SUPPLYCOST" * "PS_AVAILQTY") * (0.0001/10)
from
"PARTSUPP",
"SUPPLIER",
"NATION"
where
"PS_SUPPKEY" = "S_SUPPKEY"
and "S_NATIONKEY" = "N_NATIONKEY"
and "N_NAME" = 'GERMANY';
Whereas this one return the good results : 8102913.76524679
SELECT
SUM("PS_SUPPLYCOST" * "PS_AVAILQTY") /100000
from
"PARTSUPP",
"SUPPLIER",
"NATION"
where
"PS_SUPPKEY" = "S_SUPPKEY"
and "S_NATIONKEY" = "N_NATIONKEY"
and "N_NAME" = 'GERMANY';
Hi Romain, thanks for raising this issue, which I could reproduce. The problem boils down to our type propagation rules for numerics. So right now, Hyper is behaving as specified/documented. However, I agree with you that this is unexpected behavior, and I will check with the team if we can improve something here.