Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22957

ApproxQuantile breaks if the number of rows exceeds MaxInt

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.3.0
    • SQL
    • None

    Description

      ApproxQuantile overflows when number of rows exceeds 2.147B (max int32).

      If you run ApproxQuantile on a dataframe with 3B rows of 1 to 3B and ask it for 1/6 quantiles, it should return [0.5B, 1B, 1.5B, 2B, 2.5B, 3B]. However, in the implementation of ApproxQuantile, it calls .toInt on the target rank, which overflows at 2.147B.

      Attachments

        Activity

          People

            juliuszsompolski Juliusz Sompolski
            juliuszsompolski Juliusz Sompolski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: