xuefuz 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_r317731126
##########
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);
+ boolean.class, boolean.class, boolean.class);
return (SimpleGenericUDAFParameterInfo)
constructor.newInstance(params, isWindowing, distinct, allColumns);
} catch (NoSuchMethodException | IllegalAccessException |
InstantiationException | InvocationTargetException e) {
throw new CatalogException("Failed to create
SimpleGenericUDAFParameterInfo", e);
}
}
+
Review comment:
This is actually desirable as there was missing a new line at the end of
file.
----------------------------------------------------------------
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]
With regards,
Apache Git Services