Gopal V created HIVE-18394:
------------------------------

             Summary: Materialized view: "Create Materialized View" should 
default to rewritable ones
                 Key: HIVE-18394
                 URL: https://issues.apache.org/jira/browse/HIVE-18394
             Project: Hive
          Issue Type: Improvement
          Components: Materialized views
            Reporter: Gopal V


This is a usability ticket, since it is possible to end up creating 
materialized views and realize that they need an additional flag to be picked 
up by the optimizer to do rewrites to.

{code}
create materialized view ca as select * from customer, customer_address where 
c_current_addr_sk = ca_address_sk;
set hive.materializedview.rewriting=true;
select count(1) from customer, customer_address where c_current_addr_sk = 
ca_address_sk; -- does not use materialized view
{code}

Needs another step

{code}
alter materialized view ca enable rewrite;
{code}

And then, it kicks in 

{code}
select count(1) from customer, customer_address where c_current_addr_sk = 
ca_address_sk;
OK
12000000
Time taken: 0.494 seconds, Fetched: 1 row(s)
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to