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

SemanticException: Ambiguous column reference

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.14.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When running the following query:

      SELECT if( COUNT(*) = 0, 'true', 'false' ) as RESULT FROM ( select  *  from sim a join sim2 b on a.simstr=b.simstr) app
      
      Error: Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference simstr in app (state=42000,code=10007)
      

      This query works fine in hive 0.10

      In the apache trunk, following workaround will work:

      SELECT if(COUNT(*) = 0, 'true', 'false') as RESULT FROM (select a.* from sim a join sim2 b on a.simstr=b.simstr) app;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                navis Navis Ryu
                Reporter:
                ychena Yongzhi Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: