Closed exanm closed 3 years ago
Currently, the virtual schemas do not provide correct types for literals at all. So this is just one single case of a huge missing feature. Closing.
This is not just about the returned data type, but about wrong queries leading to wrong result sets.
Here is an example showing different result sets for native and virtual queries:
CREATE TABLE native.t(a DECIMAL(36,0));
INSERT INTO native.t VALUES (123456789012345678901234567890123456);
SELECT * FROM native.t WHERE a = CAST(123456789012345678901234567890123456 AS DOUBLE); -- returns 1 row
SELECT * FROM vs.t WHERE a = CAST(123456789012345678901234567890123456 AS DOUBLE); -- returns 0 rows
As discussed with @redcatbear: This is not about JDBC types, but only about literals sent from the database to the adapter as literal_double
structures.
The Exasol dialect should always add a
CAST(... AS DOUBLE)
for literal_double. Otherwise some numbers like 1E0 get parsed as DECIMAL.This is the follow-up to exasol/virtual-schema-common-java/issues/209.
How to reproduce:
The pushdown request for this query will contain a
literal_double
, but the generated pushdown will containWHERE a = 1E0
which gets parsed as DECIMAL.