You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/07/06 23:46:58 UTC

[GitHub] [hive] dantongdong opened a new pull request #2450: HIVE-25282: Drop/Alter table in REMOTE db should fail

dantongdong opened a new pull request #2450:
URL: https://github.com/apache/hive/pull/2450


   [HIVE-25282](https://issues.apache.org/jira/browse/HIVE-25282): Drop/Alter table in REMOTE db should fail


-- 
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



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


[GitHub] [hive] nrg4878 commented on a change in pull request #2450: HIVE-25282: Drop/Alter table in REMOTE db should fail

Posted by GitBox <gi...@apache.org>.
nrg4878 commented on a change in pull request #2450:
URL: https://github.com/apache/hive/pull/2450#discussion_r666401686



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -5934,6 +5936,12 @@ private void alter_table_core(String catName, String dbname, String name, Table
       catName = MetaStoreUtils.getDefaultCatalog(conf);
     }
 
+    // HIVE-25282: Drop/Alter table in REMOTE db should fail
+    Database db = get_database_core(catName, dbname);

Review comment:
       per the comment above, can you wrap this code in a try/catch and re-throw the NoSuchObjectException as an InvalidOperationException? Ideally this should throw back a NoSuchObjectException, but I am concerned about backward compatibilty with older clients.

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -5882,7 +5884,7 @@ public String getVersion() throws TException {
   @Override
   public void alter_table(final String dbname, final String name,
                           final Table newTable)
-      throws InvalidOperationException, MetaException {
+      throws InvalidOperationException, MetaException, NoSuchObjectException {

Review comment:
       so I am assuming the get_database_core() call now throws a NoSuchObjectException that we now have to account for.
   I realize the current code is a bit inconsistent when it comes to exception handling. so for drop_table(), if the table does not exist, we throw a NoSuchObjectException. But for alter_table() if the table does not exist, we catch the NoSuchObjectException and rethrow it as an InvalidOperationException. 
   Ideally they should be consistent.
   
   But I am a bit concerned about throwing a new exception from HMS. It might be backwards-incompatible with the current code. Could you instead catch this and re-throw as InvalidOperationException as well. 
   

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -5892,7 +5894,7 @@ public void alter_table(final String dbname, final String name,
   @Override
   public void alter_table_with_cascade(final String dbname, final String name,
                                        final Table newTable, final boolean cascade)
-      throws InvalidOperationException, MetaException {
+      throws InvalidOperationException, MetaException, NoSuchObjectException {
     EnvironmentContext envContext = null;

Review comment:
       same as above 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.

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

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



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


[GitHub] [hive] dantongdong commented on pull request #2450: HIVE-25282: Drop/Alter table in REMOTE db should fail

Posted by GitBox <gi...@apache.org>.
dantongdong commented on pull request #2450:
URL: https://github.com/apache/hive/pull/2450#issuecomment-880210387


   Fix has been committed to master. Closing this PR.


-- 
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



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


[GitHub] [hive] dantongdong closed pull request #2450: HIVE-25282: Drop/Alter table in REMOTE db should fail

Posted by GitBox <gi...@apache.org>.
dantongdong closed pull request #2450:
URL: https://github.com/apache/hive/pull/2450


   


-- 
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



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