sankarh commented on a change in pull request #591: HIVE-21500: Disable 
conversion of managed table to external and vice versa at source.
URL: https://github.com/apache/hive/pull/591#discussion_r274577077
 
 

 ##########
 File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java
 ##########
 @@ -803,6 +805,22 @@ public Partition alterPartition(RawStore msdb, Warehouse 
wh, String catName, Str
     return oldParts;
   }
 
+  private void checkTableTypeConversion(Database db, Table oldTbl, Table 
newTbl)
+          throws InvalidOperationException {
+    // If the given DB is enabled for replication and strict managed is false, 
then table type cannot be changed.
+    // This is to avoid migration scenarios which causes ACID table to be 
converted to external at replica.
+    // As ACID tables cannot be converted to external table and vice versa, we 
need to restrict this conversion at
+    // primary as well.
+    if (!oldTbl.getTableType().equalsIgnoreCase(newTbl.getTableType())
+        && 
!conf.getBoolean(MetastoreConf.ConfVars.STRICT_MANAGED_TABLES.getHiveName(), 
false)
+        && ReplChangeManager.isSourceOfReplication(db)) {
 
 Review comment:
   duplicate comment.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to