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

The output order of grouping columns in Pivot is different from the input order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • SQL
    • None

    Description

      For example,

      SELECT * FROM (
        SELECT course, earnings, "a" as a, "z" as z, "b" as b, "y" as y, "c" as c, "x" as x, "d" as d, "w" as w
        FROM courseSales
      )
      PIVOT (
        sum(earnings)
        FOR course IN ('dotNET', 'Java')
      )
      

      The output columns should be "a, z, b, y, c, x, d, w, ..." but now it is "a, b, c, d, w, x, y, z, ..."

      Attachments

        Activity

          People

            maryannxue Wei Xue
            maryannxue Wei Xue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: