belugabehr commented on a change in pull request #1161:
URL: https://github.com/apache/hive/pull/1161#discussion_r446983489
##########
File path: common/src/java/org/apache/hadoop/hive/common/FileUtils.java
##########
@@ -483,12 +483,6 @@ public static boolean
isActionPermittedForFileHierarchy(FileSystem fs, FileStatu
String userName, FsAction action, boolean recurse) throws Exception {
boolean isDir = fileStatus.isDir();
- FsAction dirActionNeeded = action;
- if (isDir) {
- // for dirs user needs execute privileges as well
- dirActionNeeded.and(FsAction.EXECUTE);
- }
-
Review comment:
So, I understand why this would be removed from a find-bugs perspective
(this is a no-op), but this is actually an all around bug. This should be:
```
// for dirs user needs execute privileges as well
FsAction dirActionNeeded = (isDir) ? action.and(FsAction.EXECUTE) : action;
```
##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -6475,17 +6477,17 @@ private static boolean isAllowed(Configuration conf,
ConfVars setting) {
}
public static String getNonMrEngines() {
- String result = StringUtils.EMPTY;
+ StringBuffer result = new StringBuffer();
for (String s : ConfVars.HIVE_EXECUTION_ENGINE.getValidStringValues()) {
if ("mr".equals(s)) {
continue;
}
- if (!result.isEmpty()) {
- result += ", ";
+ if (result.length() != 0) {
+ result.append(", ");
}
- result += s;
+ result.append(s);
}
- return result;
+ return result.toString();
Review comment:
Please change this to just use String#join and more human friendly.
```
Set<String> engines = new
HashSet<>(ConfVars.HIVE_EXECUTION_ENGINE.getValidStringValues());
boolean removedMR = engines.remove("mr");
LOG.debug("Found and removed MapReduce engine from list of valid execution
engines: {}", removedMR);
return String.join(", ", engines);
```
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]