Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong result when multiply by a calculus #89

Open
rferraton opened this issue Mar 22, 2023 · 1 comment
Open

wrong result when multiply by a calculus #89

rferraton opened this issue Mar 22, 2023 · 1 comment

Comments

@rferraton
Copy link

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';
@haubenmi
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants