]
Steven Hawkins resolved TEIID-3182.
-----------------------------------
Labels: (was: Teiid)
Resolution: Duplicate Issue
Duplicate of TEIID-3160
Decimal number got converted to Integer
---------------------------------------
Key: TEIID-3182
URL:
https://issues.jboss.org/browse/TEIID-3182
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.8
Environment: Teiid 8.8.1 with hive driver (hortonworks 2.0)
Reporter: Ivan Chan
Assignee: Steven Hawkins
Teiid engines converts value 1000.0 to 1000 and it doesn't keep the original data
type.
My original SQL:
select ("meat_sqft" / 1000.0) as "calcField2" from
"HDP20_default"."store" group by ("meat_sqft" / 1000.0)
and Teiid translated it to:
SELECT v_0.c_0 FROM (SELECT (g_0.meat_sqft / 1000) AS c_0 FROM HDP20_default.store AS
g_0) AS v_0 GROUP BY v_0.c_0 ORDER BY c_0 LIMIT 200001
(g_0.meat_sqft / 1000) field returns Integer instead of decimal.
However, if I use 1000.1 instead and it would work.
Original SQL:
select ("meat_sqft" / 1000.1) as "calcField2" from
"HDP20_default"."store" group by ("meat_sqft" / 1000.1)
And teiid translated it to:
SELECT v_0.c_0 FROM (SELECT (convert(g_0.meat_sqft, bigdecimal) / 1000.1) AS c_0 FROM
HDP20_default.store AS g_0) AS v_0 GROUP BY v_0.c_0 ORDER BY c_0 LIMIT 200001
I believe both 1000.0 and 1000.1 should have consistent behavior.