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

Control of BigDecimal precision and scale

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 8.0
    • 9.x
    • Query Engine
    • None
    • Release Notes, Compatibility/Configuration
    • Workaround Exists
    • Hide

      Use explicit converts to retain scale information for decimal types. example: "convert('123.00', BigDecimal )"

      Show
      Use explicit converts to retain scale information for decimal types. example: "convert('123.00', BigDecimal )"

    Description

      Problem 1: The parser defaults to parsing literals that look like bigdecimal as doubles, which have no scale.

      Workaround (which is on devcentral): You can avoid the above conversions by wrapping the values in a convert in the query (example: "convert('123.00', BigDecimal )").

      A better fix is update the parser to look for loss of scale information and to use the bigdecimal type instead.

      Problem 2: default division behavior JBEDSP-305

      Problem 3: No explicit control via the parser

      It would be good to provide explicit precision and scale via "convert(xxx, BigDecimal(10, 2))" - side note bigdecimal is a bad name for this type. it should really just be decimal

      Reference: This is related to Issue Tracker Issue 175485.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ghelblin Jerry Helbling (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: