[ 
https://issues.apache.org/jira/browse/HIVE-18991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411709#comment-16411709
 ] 

Alan Gates commented on HIVE-18991:
-----------------------------------

HiveMetaStore.drop_database_core fetches the tables in batches.  This means 
your check inside the loop for materialized views won't work.  You'll have to 
fetch all the materialized views separately first and drop them.  Then fetch 
all the other tables in batches and drop them.

> Drop database cascade doesn't work with materialized views
> ----------------------------------------------------------
>
>                 Key: HIVE-18991
>                 URL: https://issues.apache.org/jira/browse/HIVE-18991
>             Project: Hive
>          Issue Type: Bug
>          Components: Materialized views, Metastore
>    Affects Versions: 3.0.0
>            Reporter: Alan Gates
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>         Attachments: HIVE-18991.01.patch, HIVE-18991.patch
>
>
> Create a database, add a table and then a materialized view that depends on 
> the table.  Then drop the database with cascade set.  Sometimes this will 
> fail because when HiveMetaStore.drop_database_core goes to drop all of the 
> tables it may drop the base table before the materialized view, which will 
> cause an integrity constraint violation in the RDBMS.  To resolve this that 
> method should change to fetch and drop materialized views before tables.
> cc [~jcamachorodriguez]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to