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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          3d 22h 51m 1 Navis 16/Mar/12 14:15
          Patch Available Patch Available Resolved Resolved
          20d 8h 51m 1 Namit Jain 06/Apr/12 00:07
          Resolved Resolved Closed Closed
          24d 22h 4m 1 Ashutosh Chauhan 30/Apr/12 22:11
          Hide
          Hudson added a comment -

          Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/)
          HIVE-2863 Ambiguous table name or column reference message displays when table and column
          names are the same (Navis via namit) (Revision 1310126)

          Result = ABORTED
          namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1310126
          Files :

          • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
          • /hive/trunk/ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q
          • /hive/trunk/ql/src/test/queries/negative/ambiguous_table_col.q
          • /hive/trunk/ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out
          • /hive/trunk/ql/src/test/results/compiler/errors/ambiguous_table_col.q.out
          Show
          Hudson added a comment - Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/ ) HIVE-2863 Ambiguous table name or column reference message displays when table and column names are the same (Navis via namit) (Revision 1310126) Result = ABORTED namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1310126 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java /hive/trunk/ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q /hive/trunk/ql/src/test/queries/negative/ambiguous_table_col.q /hive/trunk/ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out /hive/trunk/ql/src/test/results/compiler/errors/ambiguous_table_col.q.out
          Ashutosh Chauhan made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Ashutosh Chauhan added a comment -

          This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.

          Show
          Ashutosh Chauhan added a comment - This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.
          Ashutosh Chauhan made changes -
          Fix Version/s 0.9.0 [ 12317742 ]
          Hide
          Hudson added a comment -

          Integrated in Hive-trunk-h0.21 #1356 (See https://builds.apache.org/job/Hive-trunk-h0.21/1356/)
          HIVE-2863 Ambiguous table name or column reference message displays when table and column
          names are the same (Navis via namit) (Revision 1310126)

          Result = SUCCESS
          namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1310126
          Files :

          • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
          • /hive/trunk/ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q
          • /hive/trunk/ql/src/test/queries/negative/ambiguous_table_col.q
          • /hive/trunk/ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out
          • /hive/trunk/ql/src/test/results/compiler/errors/ambiguous_table_col.q.out
          Show
          Hudson added a comment - Integrated in Hive-trunk-h0.21 #1356 (See https://builds.apache.org/job/Hive-trunk-h0.21/1356/ ) HIVE-2863 Ambiguous table name or column reference message displays when table and column names are the same (Navis via namit) (Revision 1310126) Result = SUCCESS namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1310126 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java /hive/trunk/ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q /hive/trunk/ql/src/test/queries/negative/ambiguous_table_col.q /hive/trunk/ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out /hive/trunk/ql/src/test/results/compiler/errors/ambiguous_table_col.q.out
          Namit Jain made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags Reviewed [ 10343 ]
          Resolution Fixed [ 1 ]
          Hide
          Namit Jain added a comment -

          Committed. Thanks Navis

          Show
          Namit Jain added a comment - Committed. Thanks Navis
          Hide
          Phabricator added a comment -

          njain has accepted the revision "HIVE-2863 [jira] Ambiguous table name or column reference message displays when table and column names are the same".

          REVISION DETAIL
          https://reviews.facebook.net/D2361

          BRANCH
          DPAL-975

          Show
          Phabricator added a comment - njain has accepted the revision " HIVE-2863 [jira] Ambiguous table name or column reference message displays when table and column names are the same". REVISION DETAIL https://reviews.facebook.net/D2361 BRANCH DPAL-975
          Navis made changes -
          Link This issue is duplicated by HIVE-2842 [ HIVE-2842 ]
          Navis made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Navis [ navis ]
          Hide
          Navis added a comment -

          Passed all tests.

          Show
          Navis added a comment - Passed all tests.
          Phabricator made changes -
          Field Original Value New Value
          Attachment HIVE-2863.D2361.1.patch [ 12518627 ]
          Hide
          Phabricator added a comment -

          navis requested code review of "HIVE-2863 [jira] Ambiguous table name or column reference message displays when table and column names are the same".
          Reviewers: JIRA

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

          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.

          TEST PLAN
          EMPTY

          REVISION DETAIL
          https://reviews.facebook.net/D2361

          AFFECTED FILES
          ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
          ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q
          ql/src/test/queries/negative/ambiguous_table_col.q
          ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out
          ql/src/test/results/compiler/errors/ambiguous_table_col.q.out

          MANAGE HERALD DIFFERENTIAL RULES
          https://reviews.facebook.net/herald/view/differential/

          WHY DID I GET THIS EMAIL?
          https://reviews.facebook.net/herald/transcript/5241/

          Tip: use the X-Herald-Rules header to filter Herald messages in your client.

          Show
          Phabricator added a comment - navis requested code review of " HIVE-2863 [jira] Ambiguous table name or column reference message displays when table and column names are the same". Reviewers: JIRA DPAL-975 Ambiguous table name or column reference message displays when table and column names are the same 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. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D2361 AFFECTED FILES ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java ql/src/test/queries/clientpositive/nomore_ambiguous_table_col.q ql/src/test/queries/negative/ambiguous_table_col.q ql/src/test/results/clientpositive/nomore_ambiguous_table_col.q.out ql/src/test/results/compiler/errors/ambiguous_table_col.q.out MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/5241/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
          Mauro Cazzari created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development