Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-2954

The statement fails when a column part of an ORDER BY is not specified in the SELECT.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 0.8.1
    • None
    • SQL
    • None

    Description

      Given the following table:

      CREATE TABLE `DBCSTB32` (`aaa` DOUBLE,`bbb` STRING,`ccc` STRING,`ddd` DOUBLE) ROW FORMAT
      DELIMITED FIELDS TERMINATED BY '\001' STORED AS TEXTFILE;

      The following statement fails:

      select TXT_1`aaa`, TXT_1.`bbb`
      from `DBCSTB32` TXT_1
      order by TXT_1.`bbb` asc, TXT_1.`aaa` asc, TXT_1.`ccc` asc

      ERROR: java.sql.SQLException: Query returned non-zero code: 10, cause: FAILED: Error in
      semantic analysis: Line 1:104 Invalid column reference '`ccc`'

      Adding `ccc` to the selected list of columns fixes the problem.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--HIVE-2954.D2889.1.patch
          15 kB
          Phabricator
        2. ASF.LICENSE.NOT.GRANTED--HIVE-2954.D2889.2.patch
          23 kB
          Phabricator
        3. HIVE-2954.D2889.3.patch
          18 kB
          Phabricator
        4. HIVE-2954.4.patch.txt
          15 kB
          Navis Ryu

        Issue Links

          Activity

            People

              navis Navis Ryu
              mcazzari Mauro Cazzari
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: