diff --git ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java index bb040b3..78f1a8f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java +++ ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java @@ -39,6 +39,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.JavaUtils; import org.apache.hadoop.hive.conf.HiveConf; @@ -783,6 +784,9 @@ private String downloadResource(String value, boolean convertToUnix) { FileSystem fs = FileSystem.get(new URI(value), conf); fs.copyToLocalFile(new Path(value), new Path(destinationFile.getCanonicalPath())); value = destinationFile.getCanonicalPath(); + + // add "execute" permission to downloaded resource file (needed when loading dll file) + FileUtil.chmod(value, "ugo+rx", true); if (convertToUnix && DosToUnix.isWindowsScript(destinationFile)) { try { DosToUnix.convertWindowsScriptToUnix(destinationFile);