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

ApproxQuantile breaks if the number of rows exceeds MaxInt

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: