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

query on view with CTE and alias fails with table not found error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 2.3.0
    • Component/s: Query Planning
    • Labels:
      None

      Description

      HIVE-10698 fixed one issue of the query on view with CTE, but it seems to break another case if a alias is given for the CTE.

      use bugtest;
      create table basetb(id int, name string);
      create view testv1 as
      with subtb as (select id, name from bugtest.basetb)
      select id from subtb a;
      use castest;
      explain select * from bugtest.testv1;
      hive> explain select * from bugtest.testv1;
      
      FAILED: SemanticException Line 2:21 Table not found 'subtb' in definition of VIEW testv1 [
      with subtb as (select `basetb`.`id`, `basetb`.`name` from `bugtest`.`basetb`)
      select `a`.`id` from `bugtest`.`subtb` `a`
      ] used as testv1 at Line 1:14
      

        Attachments

        1. HIVE-15231.2.patch
          4 kB
          Aihua Xu
        2. HIVE-15231.1.patch
          3 kB
          Aihua Xu

          Issue Links

            Activity

              People

              • Assignee:
                aihuaxu Aihua Xu
                Reporter:
                aihuaxu Aihua Xu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: