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

RelDataTypeSystemImpl.deriveAvgAggType typing error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Bug
    • 1.27.0
    • 1.27.0
    • core
    • None

    Description

      Currently, RelDataTypeSystemImpl.deriveAvgAggType returns the type of the input argument to the aggregation.

      This is obviously incorrect, AVG(A) where A has values [0, 1] should return .5, which is not an integer. This issue effects all SqlAggFunction's, since they ultimately use deriveAvgAggType for type inference. 

      PR here: https://github.com/apache/calcite/pull/2498

      Attachments

        Activity

          People

            Unassigned Unassigned
            keatondrebes keaton drebes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: