Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8420

Date statistics: sumOfSquares overflows long

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.4
    • 5.5.1, 6.0
    • None

    Description

      The values for Dates are large enough that squaring them overflows a "long" field. This should be converted to a double.

      StatsValuesFactory.java, line 755 DateStatsValues#updateTypeSpecificStats Add a cast to double

      sumOfSquares += ( (double)value * value * count);

      Attachments

        1. SOLR-8420.patch
          8 kB
          Tomas Eduardo Fernandez Lobbe
        2. 0001-Fix-overflow-in-date-statistics.patch
          8 kB
          Tom Hill
        3. StdDev.java
          1 kB
          Tom Hill
        4. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill
        5. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill

        Activity

          People

            tflobbe Tomas Eduardo Fernandez Lobbe
            tomsolr Tom Hill
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: