bowenli86 commented on a change in pull request #9524: [FLINK-13841][hive] 
Extend Hive version support to all 1.2 and 2.3 ve…
URL: https://github.com/apache/flink/pull/9524#discussion_r317328086
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV230.java
 ##########
 @@ -99,14 +101,35 @@ public void alterTable(IMetaStoreClient client, String 
databaseName, String tabl
                client.alter_table(databaseName, tableName, table);
        }
 
+       @Override
+       public void alterPartition(IMetaStoreClient client, String 
databaseName, String tableName, Partition partition)
+               throws InvalidOperationException, MetaException, TException {
+               String errorMsg = "Failed to alter partition for table %s in 
database %s";
+               try {
+                       Method method = 
client.getClass().getMethod("alter_partition", String.class, String.class,
+                               Partition.class, EnvironmentContext.class);
+                       method.invoke(client, databaseName, tableName, 
partition, null);
+               } catch (InvocationTargetException ite) {
+                       Throwable targetEx = ite.getTargetException();
+                       if (targetEx instanceof TException) {
+                               throw (TException) targetEx;
+                       } else {
+                               throw new 
CatalogException(String.format(errorMsg, tableName, databaseName), targetEx);
+                       }
+               } catch (NoSuchMethodException | IllegalAccessException e) {
+                       throw new CatalogException(String.format(errorMsg, 
tableName, databaseName), e);
+               }
+       }
+
        @Override
        public SimpleGenericUDAFParameterInfo 
createUDAFParameterInfo(ObjectInspector[] params, boolean isWindowing, boolean 
distinct, boolean allColumns) {
                try {
                        Constructor constructor = 
SimpleGenericUDAFParameterInfo.class.getConstructor(ObjectInspector[].class,
-                                       boolean.class, boolean.class, 
boolean.class);
 
 Review comment:
   revert?

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

Reply via email to