public static void main(String[] args) { LOG.debug("version: "+ version); System.out.println("Hive " + getVersion()); System.out.println("Git " + getUrl() + " -r " + getRevision()); System.out.println("Compiled by " + getUser() + " on " + getDate()); System.out.println("From source with checksum " + getSrcChecksum()); }
String hiveVer = HiveVersionInfo.getShortVersion(); LOG.info("Using Hive Version: " + HiveVersionInfo.getVersion() + " build: " + HiveVersionInfo.getBuildVersion()); if(!(hiveVer.startsWith("3.") || hiveVer.startsWith("4."))) { throw new IllegalStateException("postUpgrade w/execute requires Hive 3.x. Actual: " +
/** * Returns the buildVersion which includes version, * revision, user and date. */ public static String getBuildVersion(){ return HiveVersionInfo.getVersion() + " from " + HiveVersionInfo.getRevision() + " by " + HiveVersionInfo.getUser() + " source checksum " + HiveVersionInfo.getSrcChecksum(); }
@Override public String getName() { return HiveVersionInfo.getVersion(); } }
public void testVersion(){ UDFVersion udf = new UDFVersion(); Text result = udf.evaluate(); String expected = String.format("%s r%s", HiveVersionInfo.getVersion(), HiveVersionInfo.getRevision()); assertEquals(expected, result.toString()); } }
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 void testVersion() { UDFBuildVersion udf = new UDFBuildVersion(); Text result = udf.evaluate(); String expected = String.format("%s", HiveVersionInfo.getBuildVersion()); assertEquals(expected, result.toString()); } }
/** * Returns the buildVersion which includes version, * revision, user and date. */ public static String getBuildVersion(){ return HiveVersionInfo.getVersion() + " from " + HiveVersionInfo.getRevision() + " by " + HiveVersionInfo.getUser() + " source checksum " + HiveVersionInfo.getSrcChecksum(); }
private Response getHiveVersion() throws IOException { String version = HiveVersionInfo.getVersion(); return JsonBuilder.create() .put("module", "hive") .put("version", version) .build(); }
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; } }
jg.writeStringField(BUILD_ATTRIBUTE, HiveVersionInfo.getBuildVersion()); jg.writeEndObject(); } finally {
" host = " + hostname, " args = " + Arrays.asList(args), " version = " + HiveVersionInfo.getVersion(), " classpath = " + System.getProperty("java.class.path"), " build = " + HiveVersionInfo.getUrl() + " -r " + HiveVersionInfo.getRevision() + "; compiled by '" + HiveVersionInfo.getUser() + "' on " + HiveVersionInfo.getDate()}
/** * Returns the buildVersion which includes version, * revision, user and date. */ public static String getBuildVersion(){ return HiveVersionInfo.getVersion() + " from " + HiveVersionInfo.getRevision() + " by " + HiveVersionInfo.getUser() + " source checksum " + HiveVersionInfo.getSrcChecksum(); }
"version=" + HiveVersionInfo.getVersion() + ";" + "sequence="; zooKeeperHelper.addServerInstanceToZooKeeper(znodePathPrefix, znodeData, zooKeeperAclProvider, new DeRegisterWatcher(zooKeeperHelper));
String hiveVer = HiveVersionInfo.getShortVersion(); LOG.info("Using Hive Version: " + HiveVersionInfo.getVersion() + " build: " + HiveVersionInfo.getBuildVersion()); if(!hiveVer.startsWith("2.")) { throw new IllegalStateException("preUpgrade requires Hive 2.x. Actual: " + hiveVer);
/** * 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"); } }
", waitQueueSize= " + waitQueueSize + ", enablePreemption= " + enablePreemption + ", versionInfo= (" + HiveVersionInfo.getBuildVersion() + ")"; LOG.info(logMsg); final String currTSISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date());
out.print( HiveVersionInfo.getVersion() ); out.write(','); out.write(' '); out.write('r'); out.print( HiveVersionInfo.getRevision() ); out.write("</td>\n <td>Hive version and revision</td>\n </tr>\n <tr>\n <td>Hive Compiled</td>\n <td>"); out.print( HiveVersionInfo.getDate() ); out.write(','); out.write(' '); out.print( HiveVersionInfo.getUser() ); out.write("</td>\n <td>When Hive was compiled and by whom</td>\n </tr>\n <tr>\n <td>HiveServer2 Start Time</td>\n <td>"); out.print( new Date(startcode) );
/** * Returns the buildVersion which includes version, * revision, user and date. */ public static String getBuildVersion(){ return HiveVersionInfo.getVersion() + " from " + HiveVersionInfo.getRevision() + " by " + HiveVersionInfo.getUser() + " source checksum " + HiveVersionInfo.getSrcChecksum(); }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true, true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_ODBC_KEYWORDS: return new GetInfoValue(ParseUtils.getKeywords(ODBC_KEYWORDS)); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true, true); } }