pvary commented on issue #2063:
URL: https://github.com/apache/iceberg/issues/2063#issuecomment-757757783


   MANAGED and EXTERNAL tables should behave the same way in respect of the 
ALTER TABLE commands.
   
   By my current understanding the current SerDe API does not provide methods 
to handle ALTER TABLE commands.
   The 3.1.2 version of the API contains this method which is added by 
[HIVE-19049](https://issues.apache.org/jira/browse/HIVE-19049) in Hive 3.0.0:
   ```
     /**
      * Called before a table is altered in the metastore
      * during ALTER TABLE.
      *
      * @param table new table definition
      */
     public default void preAlterTable(Table table, EnvironmentContext context) 
throws MetaException {
       String alterOpType = (context == null || context.getProperties() == 
null) ?
           null : context.getProperties().get(ALTER_TABLE_OPERATION_TYPE);
       // By default allow only ADDPROPS and DROPPROPS.
       // alterOpType is null in case of stats update.
       if (alterOpType != null && !allowedAlterTypes.contains(alterOpType)){
         throw new MetaException(
             "ALTER TABLE can not be used for " + alterOpType + " to a 
non-native table ");
       }
     }
   ```
   This could be implemented to do schema evoulution, but this is not present 
in Hive 2.3.7.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to