Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3182

Decimal number got converted to Integer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 8.8
    • Query Engine
    • None
    • Hide

      Read description.

      Show
      Read description.

      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.

            rhn-engineering-shawkins Steven Hawkins
            mchantibco Ivan Chan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: