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

Predicates pushdown to REAL type in MySQL and MemSQL return incorrect result #9998

Closed
ebyhr opened this issue Nov 19, 2021 · 5 comments · Fixed by #10000
Closed

Predicates pushdown to REAL type in MySQL and MemSQL return incorrect result #9998

ebyhr opened this issue Nov 19, 2021 · 5 comments · Fixed by #10000
Assignees
Labels
bug Something isn't working correctness

Comments

@ebyhr
Copy link
Member

ebyhr commented Nov 19, 2021

trino> create table tpch.test_real (c1 real);
trino> insert into tpch.test_real values (real '3.14');

trino> desc tpch.test_real;
 Column | Type | Extra | Comment 
--------+------+-------+---------
 c1     | real |       |      

trino> select * from tpch.test_real;
  c1  
------
 3.14 

trino> select * from tpch.test_real where c1 = real '3.14';
 c1 
----
(0 rows)

I haven't confirmed all connectors, but PostgreSQL works fine.

@findepi
Copy link
Member

findepi commented Nov 19, 2021

Any clue why this wasn't found by AbstractTestDistributedQueries#testDataMappingSmokeTest?

@ebyhr
Copy link
Member Author

ebyhr commented Nov 20, 2021

@findepi Because these connectors were overriding filterDataMappingSmokeTestData method even though the type is supported:

        if (typeName.equals("real")
                || typeName.equals("timestamp")) {
            // TODO this should either work or fail cleanly
            return Optional.empty();
        }

@ssheikin
Copy link
Contributor

@ebyhr
Is the root cause known which causes the incorrect result?
Why it does not cause incorrect results for double type?

@ebyhr
Copy link
Member Author

ebyhr commented Sep 18, 2024

@ssheikin Sorry, I don't remember the details. I think the implementation in both JDBC drivers and servers has been changed. It worth checking the latest behavior.

@ssheikin
Copy link
Contributor

ssheikin commented Sep 19, 2024

For ClickHouse with 3.14 it's still reproducible for float, but not for double.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness
3 participants