Bin/hive prompts "XXX illegal hadoop version: Unknown (expected a. B. * Format)" similar to this problem,
View code
public static String getMajorVersion() { String vers = VersionInfo.getVersion(); String[] parts = vers.split("\\."); if (parts.length < 2) { throw new RuntimeException("Illegal Hadoop Version: " + vers + " (expected A.B.* format)"); } String majorVersion = parts[0] + "." + parts[1]; // If we are running a security release, we won‘t have UnixUserGroupInformation // (removed by HADOOP-6299 when switching to JAAS for Login) try { Class.forName("org.apache.hadoop.security.UnixUserGroupInformation"); } catch (ClassNotFoundException cnf) { if ("0.20".equals(majorVersion)) { majorVersion += "S"; } } return majorVersion; }
String vers = versioninfo. getversion (); no value is obtained here.
View "Import org. Apache. hadoop. util. versioninfo ;"
I learned that the reference here is the hadoop package, so the hadoop-core.jar package into the lib directory, the problem solved!