String hiveVer = HiveVersionInfo.getShortVersion(); LOG.info("Using Hive Version: " + HiveVersionInfo.getVersion() + " build: " + HiveVersionInfo.getBuildVersion());
String hiveVer = HiveVersionInfo.getShortVersion(); LOG.info("Using Hive Version: " + HiveVersionInfo.getVersion() + " build: " + HiveVersionInfo.getBuildVersion());
public static String getHiveSchemaVersion() { String hiveVersion = HiveVersionInfo.getShortVersion(); // if there is an equivalent version, return that, else return this version String equivalentVersion = EQUIVALENT_VERSIONS.get(hiveVersion); if (equivalentVersion != null) { return equivalentVersion; } else { return hiveVersion; } }
public static String getHiveSchemaVersion() { String hiveVersion = HiveVersionInfo.getShortVersion(); // if there is an equivalent version, return that, else return this version String equivalentVersion = EQUIVALENT_VERSIONS.get(hiveVersion); if (equivalentVersion != null) { return equivalentVersion; } else { return hiveVersion; } }
/** * Due to Java 7 not allowing static methods/method implementations inside an interface, we're * not really able to abstract the shim version support logic in any meaningful way. Once the * language level for the project is able to be bumped to Java 8, this can definitely be * refactored. */ private static DynamoDbHiveShims loadHiveShims() { String hiveVersion = HiveVersionInfo.getShortVersion(); if (DynamoDbHive1Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive1Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 1.x shim class"); } } else if (DynamoDbHive1Dot2Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive1Dot2Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 1.2.x shim class"); } } else if (DynamoDbHive2Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive2Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 2.x shim class"); } } else { throw new RuntimeException("Shim class for Hive version " + hiveVersion + " does not exist"); } }
/** * Due to Java 7 not allowing static methods/method implementations inside an interface, we're * not really able to abstract the shim version support logic in any meaningful way. Once the * language level for the project is able to be bumped to Java 8, this can definitely be * refactored. */ private static DynamoDbHiveShims loadHiveShims() { String hiveVersion = HiveVersionInfo.getShortVersion(); if (DynamoDbHive1Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive1Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 1.x shim class"); } } else if (DynamoDbHive1Dot2Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive1Dot2Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 1.2.x shim class"); } } else if (DynamoDbHive2Shims.supportsVersion(hiveVersion)) { try { return DynamoDbHive2Shims.class.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("unable to get instance of Hive 2.x shim class"); } } else { throw new RuntimeException("Shim class for Hive version " + hiveVersion + " does not exist"); } }
String hiveVer = HiveVersionInfo.getShortVersion(); if(preUpgrade) { if(!hiveVer.startsWith("2.")) {