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

A bug with `Group by ordinal`

    XMLWordPrintableJSON

Details

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

    Description

      create temporary view data as select * from values
      (1, 1),
      (1, 2),
      (2, 1),
      (2, 2),
      (3, 1),
      (3, 2)
      as data(a, b);

      select 3, 4, sum(b) from data group by 1, 2;
      When running this case, the following exception occurred:
      Error in query: GROUP BY position 4 is not in select list (valid range is [1, 3]); line 1 pos 10

      But this case can run normally:select 1, 2, sum(b) from data group by 1, 2;

      Attachments

        Activity

          People

            10110346 liuxian
            10110346 liuxian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: