Hive
  1. Hive
  2. HIVE-2863

Ambiguous table name or column reference message displays when table and column names are the same

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Given the following table:

      CREATE TABLE `Y` (`y` DOUBLE) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' STORED AS TEXTFILE;

      The following query fails:

      SELECT `Y`.`y` FROM `Y` WHERE ( `y` = 1 )
      ERROR: java.sql.SQLException: Query returned non-zero code: 10, cause: FAILED: Error in
      semantic analysis: Line 1:36 Ambiguous table alias or column reference '`y`'
      ERROR: Unable to execute Hadoop query.
      ERROR: Prepare error. SQL statement: SELECT `Y`.`y` FROM `Y` WHERE ( `y` = 1 ).

      The problem goes away if the table and column names do not match.

        Issue Links

          Activity

          Mauro Cazzari created issue -
          Phabricator made changes -
          Field Original Value New Value
          Attachment HIVE-2863.D2361.1.patch [ 12518627 ]
          Navis made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Navis [ navis ]
          Navis made changes -
          Link This issue is duplicated by HIVE-2842 [ HIVE-2842 ]
          Namit Jain made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags Reviewed [ 10343 ]
          Resolution Fixed [ 1 ]
          Ashutosh Chauhan made changes -
          Fix Version/s 0.9.0 [ 12317742 ]
          Ashutosh Chauhan made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Navis
              Reporter:
              Mauro Cazzari
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development