jerryshao commented on a change in pull request #841: Upgrade Hive to 2.3.6 for Iceberg URL: https://github.com/apache/incubator-iceberg/pull/841#discussion_r392023600
########## File path: hive/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java ########## @@ -83,6 +86,18 @@ protected HiveTableOperations(Configuration conf, HiveClientPool metaClients, St this.tableName = table; this.lockAcquireTimeout = conf.getLong(HIVE_ACQUIRE_LOCK_STATE_TIMEOUT_MS, HIVE_ACQUIRE_LOCK_STATE_TIMEOUT_MS_DEFAULT); + try { + this.alterTableMethod = HiveMetaStoreClient.class.getMethod("alter_table_with_environmentContext", + String.class, String.class, Table.class, EnvironmentContext.class); + } catch (NoSuchMethodException e) { + try { + this.alterTableMethod = HiveMetaStoreClient.class.getMethod("alter_table", + String.class, String.class, Table.class, EnvironmentContext.class); + } catch (NoSuchMethodException inner) { + throw new RuntimeMetaException(inner, "Fail to find method alter_table_with_environmentContext and " + + "alter_table with right signature"); + } Review comment: Use reflection to handle the API difference between Hive 1.2.1 and 2.3.6. ---------------------------------------------------------------- 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: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org