Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11485

ArithmeticException in avgFunctionForDecimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 3.0.6, 3.6
    • Legacy/CQL
    • None
    • Low

    Description

      I am running into issues when using avg in queries on decimal values.
      It throws an ArithmeticException in org/apache/cassandra/cql3/functions/AggregateFcts.java (Line 184).

      So whenever an exact representation of the quotient is not possible it will throw that error and it never returns to the querying client.

      I am not so sure if this is intended behavior or a bug, but in my opinion if an exact representation of the value is not possible, it should automatically round the value.
      Specifying a rounding mode when calling the divide function should solve the issue

      Attachments

        Activity

          People

            snazy Robert Stupp
            nhaller Nico Haller
            Robert Stupp
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: