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

query on view results fails with table not found error if view is created with subquery alias (CTE).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 2.0.0
    • Query Planning
    • None

    Description

      To reproduce it,

      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;
      use castest;
      explain select * from bugtest.testv1;
      hive> explain select * from bugtest.testv1;
      FAILED: SemanticException Line 2:15 Table not found 'subtb' in definition of VIEW testv1 [
      with subtb as (select id, name from bugtest.basetb)
      select id from `bugtest`.`subtb`
      ] used as testv1 at Line 1:22
      Note that there is a database prefix `bugtest`.`subtb`
      

      Attachments

        1. HIVE-10698.01.patch
          14 kB
          Pengcheng Xiong

        Issue Links

          Activity

            People

              pxiong Pengcheng Xiong
              pxiong Pengcheng Xiong
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: