Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6464

Type inference for DECIMAL division seems incorrect

    XMLWordPrintableJSON

Details

    Description

      This bug surfaces if one uses a custom type system, e.g., where DECIMAL is limited to (28, 10).
      The problem is in RelDataTypeSystem.deriveDecimalDivideType.
      The JavaDoc of this function gives the algorithm for deriving the division result type.
      According to these rules, if you divide two numbers of type DECIMAL(28, 10), you should get a result with type DECIMAL(28, 10).
      But the actual implementation infers a type of DECIMAL(28, 0), which seems incorrect.

      Attachments

        Issue Links

          Activity

            People

              mbudiu Mihai Budiu
              mbudiu Mihai Budiu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: