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

Type inferred for result of STDDEV, VAR_SAMP, etc. is incorrect

    XMLWordPrintableJSON

Details

    Description

      These functions are all use the same type inference algorithm, essentially the algorithm used by AVG.

      But if the values processed are decimal, STDDEV (and others) need much higher precision to represent the result. (I am not sure that the inference is right for integer types either, btw.)

      This surfaced during the implementation of a fix for CALCITE-6322: if we use the type inferred for these functions, the result overflows and causes a runtime exception.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: