You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/10/05 08:57:00 UTC

[jira] [Work logged] (HIVE-25590) Able to create views referencing temporary tables and materialized views

     [ https://issues.apache.org/jira/browse/HIVE-25590?focusedWorklogId=660164&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-660164 ]

ASF GitHub Bot logged work on HIVE-25590:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Oct/21 08:56
            Start Date: 05/Oct/21 08:56
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #2697:
URL: https://github.com/apache/hive/pull/2697


   ### What changes were proposed in this pull request?
   When validating view/materialized view instead of checking the tables in the top QB object check all TableScan operators for temp tables and MVs
   
   ### Why are the changes needed?
   Checking the top QB object is often not enough: subqueries may contain MV and temp table scans.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. At create [materialized]view if view definition has subqueries referencing temp tables and/or materialized views an error message is printed.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestNegativeLlapLocalCliDriver -Dqfile=materialized_view_create_failure.q,create_view_failure11.q,create_view_failure12.q -pl itests/qtest -Pitests
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 660164)
    Remaining Estimate: 0h
            Time Spent: 10m

> Able to create views referencing temporary tables and materialized views
> ------------------------------------------------------------------------
>
>                 Key: HIVE-25590
>                 URL: https://issues.apache.org/jira/browse/HIVE-25590
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>             Fix For: 4.0.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Creating views/materialized views referencing temporary tables and materialized views are disabled in Hive. However the verification algorithm fails to recognize temporary tables and materialized views in subqueries. 
> The verification also fails when the view definition contains joins because CBO transforms join branches to subqueries.
> Example1:
> {code}
> create temporary table tmp1 (c1 string, c2 string);
> create view tmp1_view as
> select subq.c1 from (select c1, c2 from tmp1) subq;
> {code}
> Example2:
> {code}
> create table t1 (a int) stored as orc tblproperties ('transactional'='true');
> create table t2 (a int) stored as orc tblproperties ('transactional'='true');
> create materialized view mv1 as
> select a from t1 where a = 10;
> create materialized view mv2 as
> select t2.a from mv1
> join t2 on (mv1.a = t2.a);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)