You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/05/29 09:24:44 UTC

[GitHub] [hive] pjfanning opened a new pull request, #3330: HIVE-26272: inline util code that is used from log4j jar

pjfanning opened a new pull request, #3330:
URL: https://github.com/apache/hive/pull/3330

   ### What changes were proposed in this pull request?
   The use of log4j util code in Hive causes some trouble in Drill - see [HIVE-26272](https://issues.apache.org/jira/browse/HIVE-26272)
   
   
   ### Why are the changes needed?
   Apache Drill issues 
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   CI build


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pjfanning commented on a diff in pull request #3330: HIVE-26272: inline util code that is used from log4j jar

Posted by GitBox <gi...@apache.org>.
pjfanning commented on code in PR #3330:
URL: https://github.com/apache/hive/pull/3330#discussion_r885073402


##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -442,6 +441,26 @@ public synchronized void init(HiveConf hiveConf) {
     ShutdownHookManager.addShutdownHook(() -> hiveServer2.stop());
   }
 
+  /**
+   * Checks if a String is blank. A blank string is one that is either
+   * {@code null}, empty, or all characters are {@link Character#isWhitespace(char)}.
+   *
+   * @param s the String to check, may be {@code null}
+   * @return {@code true} if the String is {@code null}, empty, or all characters are {@link Character#isWhitespace(char)}
+   */
+  private static boolean isBlank(final String s) {
+    if (s == null || s.isEmpty()) {
+      return true;
+    }
+    for (int i = 0; i < s.length(); i++) {
+      final char c = s.charAt(i);
+      if (!Character.isWhitespace(c)) {
+        return false;
+      }
+    }
+    return true;
+  }
+

Review Comment:
   changed using new commit - to use commons-lang3 StringUtils.isBlank



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn merged pull request #3330: HIVE-26272: inline util code that is used from log4j jar

Posted by GitBox <gi...@apache.org>.
ayushtkn merged PR #3330:
URL: https://github.com/apache/hive/pull/3330


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on a diff in pull request #3330: HIVE-26272: inline util code that is used from log4j jar

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on code in PR #3330:
URL: https://github.com/apache/hive/pull/3330#discussion_r885071286


##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -442,6 +441,26 @@ public synchronized void init(HiveConf hiveConf) {
     ShutdownHookManager.addShutdownHook(() -> hiveServer2.stop());
   }
 
+  /**
+   * Checks if a String is blank. A blank string is one that is either
+   * {@code null}, empty, or all characters are {@link Character#isWhitespace(char)}.
+   *
+   * @param s the String to check, may be {@code null}
+   * @return {@code true} if the String is {@code null}, empty, or all characters are {@link Character#isWhitespace(char)}
+   */
+  private static boolean isBlank(final String s) {
+    if (s == null || s.isEmpty()) {
+      return true;
+    }
+    for (int i = 0; i < s.length(); i++) {
+      final char c = s.charAt(i);
+      if (!Character.isWhitespace(c)) {
+        return false;
+      }
+    }
+    return true;
+  }
+

Review Comment:
   Can't we directly use ``StringUtils.isBlank()`` rather than implementing our own stuff? If we want to do so in that case we should put it in some Util class then....



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org